Esempio n. 1
0
 public override void Tick()
 {
     if (sequenceInterpreter != null)
     {
         sequenceInterpreter.Tick();
         if (sequenceInterpreter.SequenceFinished)
         {
             Debug.Log("Sequence finished");
             this.sequenceInterpreter = null;
         }
     }
 }
Esempio n. 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);
     }
 }
Esempio n. 3
0
 void Update()
 {
     if (localExecution && interpreter != null)
     {
         interpreter.Tick();
         if (interpreter.SequenceFinished)
         {
             interpreter = null;
             if (loop)
             {
                 Launch();
             }
         }
     }
 }
Esempio n. 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);
            }
        }