예제 #1
0
        private IEnumerator timerCoroutine()
        {
            float timeLeft = timeout;

            while (timeLeft > 0)
            {
                yield return(null);

                if (state == State.Processing)
                {
                    timeLeft -= timeManager.GetDeltaTime();
                    process(timeLeft);
                }
            }
            this.Stop();
        }
예제 #2
0
        protected virtual IEnumerator Simulate()
        {
            CurTime = 0.0f;
            simulator.Init();

            while (state != State.Stopped)
            {
                if (state != State.Paused)
                {
                    CurTime += timeManager.GetDeltaTime();

                    if (CurTime < Duration)
                    {
                        simulator.Simulate(CurTime);
                    }
                    else
                    {
                        simulator.Simulate(Duration);
                        Stop();
                    }
                }
                yield return(null);
            }
        }