海淀天下城电子沙盘单机版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

65 lines
2.2 KiB

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<BaseGameObjInfo>().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);
}
}
}