コード例 #1
0
        protected void ExecuteState(TStateType state)
        {
            if (!ValidateTransition(state))
            {
                return;
            }
            PreviousState = CurrentState;

            StateLogger.LogStateChanged(this?.GetType().Name,
                                        CurrentState?.GetType().Name, state?.GetType().Name);

            CurrentState = state;
            ChangeState(state);
        }
コード例 #2
0
        public void Execute(TState state)
        {
            StateLogger.LogStateChanged(this, State, state);

            GameProfiler.BeginSample("Stop state");
            Stop();
            GameProfiler.EndSample();

            State = state;
            StateEnter(State);

            GameProfiler.BeginSample("ExecuteState");
            _executor.Execute(state);
            GameProfiler.EndSample();
        }