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.
48 lines
1.7 KiB
48 lines
1.7 KiB
using AX.InputSystem; |
|
using AX.MessageSystem; |
|
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
|
|
public class ObjselecteEventReplay : MonoBehaviour { |
|
|
|
// Use this for initialization |
|
void Start () { |
|
MessageDispatcher.AddListener("ReplayEvent", ReplayEventSelect); |
|
} |
|
private void OnDestroy() |
|
{ |
|
MessageDispatcher.RemoveListener("ReplayEvent", ReplayEventSelect); |
|
} |
|
private void ReplayEventSelect(IMessage obj) |
|
{ |
|
var eventData = (EventData)obj.Data; |
|
|
|
// var hitObj = EntitiesManager.Instance.GetEntityByID(long.Parse(eventData.json)); |
|
// if (hitObj == gameObject) |
|
{ |
|
if (eventData.eventType == RecordEventType.RadioSelect) |
|
{ |
|
RadioSelectedCommand.Instance.Execute(long.Parse(eventData.json), (CmdArgs)null); |
|
} |
|
else if (eventData.eventType == RecordEventType.EscCancelSelected) |
|
{ |
|
CancelSelectedCommand.Instance.Execute(0, (CmdArgs)null); |
|
} |
|
else if (eventData.eventType == RecordEventType.CancelObjSelected) |
|
{ |
|
var hitObj = EntitiesManager.Instance.GetEntityByID(long.Parse(eventData.json)); |
|
MessageDispatcher.SendMessage(hitObj, "CANCEL_OBJ_SELECTED"); |
|
} |
|
else if (eventData.eventType == RecordEventType.ObjRectSelected) |
|
{ |
|
var hitObj = EntitiesManager.Instance.GetEntityByID(long.Parse(eventData.json)); |
|
MessageDispatcher.SendMessage(hitObj, "OBJ_RECT_SELECTED"); |
|
} |
|
} |
|
|
|
} |
|
|
|
|
|
}
|
|
|