Example #1
0
 public override void Tick()
 {
     if (sequenceInterpreter != null)
     {
         sequenceInterpreter.Tick();
         if (sequenceInterpreter.SequenceFinished)
         {
             Debug.Log("Sequence finished");
             this.sequenceInterpreter = null;
         }
     }
 }
Example #2
0
 public override void ReceiveEvent(IGameEvent ev)
 {
     if (sequenceInterpreter == null)
     {
         if (ev.Name.ToLower() == "start sequence")
         {
             Sequence secuence = (ev.getParameter("Sequence") as Sequence);
             sequenceInterpreter = new SequenceInterpreter(secuence);
         }
     }
     else
     {
         sequenceInterpreter.EventHappened(ev);
     }
 }
Example #3
0
 void Update()
 {
     if (localExecution && interpreter != null)
     {
         interpreter.Tick();
         if (interpreter.SequenceFinished)
         {
             interpreter = null;
             if (loop)
             {
                 Launch();
             }
         }
     }
 }
Example #4
0
        private void Launch()
        {
            if (interpreter != null || localSequence == null)
            {
                return;
            }

            if (localExecution)
            {
                if (interpreter == null)
                {
                    interpreter = new SequenceInterpreter(localSequence);
                }
            }
            else
            {
                // Remote start
                ge = new GameEvent("start sequence", new System.Collections.Generic.Dictionary <string, object> ()
                {
                    { "sequence", localSequence }
                });
                Game.main.enqueueEvent(ge);
            }
        }