public void SetState(HostileState f_state) { if (currentState != null) { currentState.OnStateExit(); } currentState = f_state; //this.gameObject.name = "This Object is in the state: " + f_state.GetType().Name; if (currentState != null) { currentState.OnStateEnter(); } }
public void SetState(HostileState newState) { if (currentState != null) { currentState.OnStateExit(); } currentState = newState; if (currentState != null) { currentState.OnStateEnter(); } //Debug.Log("new Hostile state: " + currentState.name); }