Пример #1
0
        public void ChangeState(SO_State newState)
        {
            if (newState == null)
            {
                return;
            }

            if (CurrentState != null)
            {
                // Performing Exit Actions
                CurrentState.ExitState(this);
            }

            CurrentState = newState;

            // Performing Enter actions
            CurrentState.EnterState(this);
        }
Пример #2
0
 public PluggableStateMachine(GameObject ownerGameObject, SO_State defaultState)
 {
     gameObject = ownerGameObject;
     ChangeState(defaultState);
     _IsActive = true;
 }