Beispiel #1
0
 public DelayedEvent(Fsm fsm, FsmEvent fsmEvent, float delay)
 {
     this.fsm      = fsm;
     timer         = delay;
     this.fsmEvent = fsmEvent;
     eventData     = new FsmEventData(Fsm.EventData)
     {
         SentByFsm    = FsmExecutionStack.ExecutingFsm,
         SentByState  = FsmExecutionStack.ExecutingState,
         SentByAction = FsmExecutionStack.ExecutingAction
     };
 }
Beispiel #2
0
 public void Update()
 {
     timer -= Time.deltaTime;
     if (timer < 0f)
     {
         FsmEventData fsmEventData = Fsm.EventData;
         Fsm.EventData = eventData;
         if (eventTarget == null)
         {
             fsm.Event(fsmEvent);
         }
         else
         {
             fsm.Event(eventTarget, fsmEvent);
         }
         fsm.UpdateStateChanges();
         eventFired    = true;
         eventData     = null;
         Fsm.EventData = fsmEventData;
     }
 }
Beispiel #3
0
 public FsmEventData(FsmEventData source)
 {
     SentByFsm          = source.SentByFsm;
     SentByState        = source.SentByState;
     SentByAction       = source.SentByAction;
     BoolData           = source.BoolData;
     IntData            = source.IntData;
     FloatData          = source.FloatData;
     Vector2Data        = source.Vector2Data;
     Vector3Data        = source.Vector3Data;
     StringData         = source.StringData;
     QuaternionData     = source.QuaternionData;
     RectData           = source.RectData;
     ColorData          = source.ColorData;
     ObjectData         = source.ObjectData;
     GameObjectData     = source.GameObjectData;
     MaterialData       = source.MaterialData;
     TextureData        = source.TextureData;
     Player             = source.Player;
     DisconnectionInfo  = source.DisconnectionInfo;
     ConnectionError    = source.ConnectionError;
     NetworkMessageInfo = source.NetworkMessageInfo;
     MasterServerEvent  = source.MasterServerEvent;
 }