예제 #1
0
 public void ExecuteScript(MiScript script)
 {
     MiScriptState scriptState = new MiScriptState(script);
     if (!scriptState.IsComplete())
     {
         activeScripts.Add(scriptState);
     }
 }
예제 #2
0
        public void ExecuteScript(MiScript script)
        {
            MiScriptState scriptState = new MiScriptState(script);

            if (!scriptState.IsComplete())
            {
                activeScripts.Add(scriptState);
            }
        }
예제 #3
0
 public MiScriptState(MiScript script)
 {
     scriptEnumerator = script();
     if (scriptEnumerator == null)
     {
         this.script = null;
     }
     else
     {
         this.script = script;
         sleepTime   = scriptEnumerator.Current;
     }
 }
예제 #4
0
        public void Execute(GameTime gameTime)
        {
            if (sleepTime > 0)
            {
                sleepTime--;
            }

            if (sleepTime <= 0)
            {
                bool unfinished = false;
                do
                {
                    unfinished = scriptEnumerator.MoveNext();
                    sleepTime  = scriptEnumerator.Current;
                }while (sleepTime <= 0 && unfinished);

                if (!unfinished)
                {
                    script = null;
                }
            }
        }