using AX.MessageSystem; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class DashedLineRotate : ObjRotate { protected override void AddRecordEventRoage(RecordEventType type) { if (ReplaySetting.PlayStatus == PlayStatus.isEditor && RecordManager.Instance.recordStatus == RecordStatus.normal) { var eventData = new EventData(); eventData.time = RecordManager.Instance.RecordTimer; eventData.cloneObjType = GetComponent().gameObjType; eventData.eventType = type; eventData.json = gameObject.name; RecordManager.Instance.jsonData.eventDataList.Add(eventData); } } protected override void ReplayEventRoate(IMessage obj) { var eventData = (EventData)obj.Data; if (eventData.json == gameObject.name) { if (eventData.eventType == RecordEventType.LeftRotate) { foreach(Transform child in transform) { child.Rotate(0, -Time.deltaTime * rotateSpeed, 0, Space.World); } } else if (eventData.eventType == RecordEventType.RightRotate) { foreach (Transform child in transform) { child.Rotate(0, Time.deltaTime * rotateSpeed, 0, Space.World); } } } } protected override void LeftRotate(IMessage obj) { if (SelectedObjs.selectedObj == gameObject) { foreach (Transform child in transform) { child.Rotate(0, -Time.deltaTime * rotateSpeed, 0, Space.World); } AddRecordEventRoage(RecordEventType.LeftRotate); } } protected override void RightRotate(IMessage obj) { if (SelectedObjs.selectedObj == gameObject) { foreach (Transform child in transform) { child.Rotate(0, Time.deltaTime * rotateSpeed, 0, Space.World); } AddRecordEventRoage(RecordEventType.RightRotate); } } }