Ejemplo n.º 1
0
        public void Update(float deltaTime)
        {
            if (State == TimerStates.Running)
            {
                Elapsed += deltaTime;

                if (Elapsed >= lastInterval)
                {
                    OnTick.Dispatch(Count, deltaTime);
                    Count++;
                    lastInterval += Interval;
                }

                if (Elapsed >= Duration)
                {
                    State = TimerStates.Finished;
                    OnFinish.Dispatch();
                }
            }
        }