public void SetState(Enum stateToActivate, ITTStateMachine useGameStateMachine) { if (state.executingStateMachine == useGameStateMachine && stateToActivate == state.currentState) { return; } if (_exitedState && _enteredState) { _exitedState = false; _enteredState = false; } else { return; } ChangingState(); state.currentState = stateToActivate; state.executingStateMachine = useGameStateMachine; if (useGameStateMachine != this) { useGameStateMachine.baseStateMachine = this; } state.executingStateMachine.state.currentState = stateToActivate; useGameStateMachine.Represent(gameObject); ConfigureCurrentState(); }
protected virtual void OnAwake() { state.executingStateMachine = baseStateMachine = this; _exitedState = true; _enteredState = true; localTransform = base.transform; Represent(base.gameObject); }
void ChangingState() { lastState = state.currentState; lastGameStateMachineBehavior = state.executingStateMachine; _timeEnteredState = Time.time; }