Esempio n. 1
0
    public void Next()
    {
        if (NextState != null)
        {
            State?.OnExit();
            Context.NextTick = 0;
            State            = NextState;
            State.OnEnter();
            NextState = null;
        }

        NextState = State.Execute();
    }
Esempio n. 2
0
        public void Next()
        {
            if (Environment.TickCount < Context.NextTick)
            {
                return;
            }

            Context.NextTick = Environment.TickCount + 200; // Wait 200ms between execution

            if (NextState != null)
            {
                State?.OnExit();
                State = NextState;
                State.OnEnter();
                NextState = null;
            }

            NextState = State.Execute();
        }