/// <inheritdoc />
            public override IEnumerator Update()
            {
                if (Data.PlaysOnRepeat == false)
                {
                    yield break;
                }

                int endlessLoopCheck = 0;

                while (endlessLoopCheck < 100000)
                {
                    IEnumerator update = childProcess.Update();

                    while (update.MoveNext())
                    {
                        yield return(null);
                    }

                    childProcess.End();

                    childProcess.Start();

                    endlessLoopCheck++;
                }
            }
Example #2
0
        private void FinishCurrentState()
        {
            update = null;

            process.End();

            fastForwardedStates[Stage] = false;

            switch (Stage)
            {
            case Stage.Inactive:
                return;

            case Stage.Activating:
                StartActive();
                return;

            case Stage.Active:
                return;

            case Stage.Deactivating:
                StartInactive();
                return;
            }
        }
Example #3
0
 public static void Remove(IProcess process)
 {
     if (mProcesses.Contains(process))
     {
         process.End();
         mProcesses.Remove(process);
     }
 }
Example #4
0
 public static void Update()
 {
     if (mProcesses.Count == 0)
     {
         return;
     }
     mTempProcesses.Clear();
     mTempProcesses.AddRange(mProcesses);
     for (int i = 0; i < mTempProcesses.Count; i++)
     {
         IProcess ip = mTempProcesses[i];
         if (!mProcesses.Contains(ip))
         {
             continue;
         }
         if (!ip.IsFinished())
         {
             ip.Update(Time.deltaTime * Speed);
             if (ip is Process && (ip as Process).onUpdate != null)
             {
                 (ip as Process).onUpdate(Time.deltaTime * Speed);
             }
         }
         else
         {
             ip.End();
             mProcesses.Remove(ip);
             if (ip != null && ip is Process)
             {
                 if ((ip as Process).NextProcess != null)
                 {
                     Add((ip as Process).NextProcess);
                 }
             }
         }
     }
 }
Example #5
0
 public void RemoveProcess(IProcess process)
 {
     process.End();
     processes.Remove(process);
 }
Example #6
0
 private void CloseService()
 {
     _process.End();
     _process = null;
 }