// Use this for initialization void Start() { // Caching gm = GameManager.GetInstance(); currentState = playerCState; }
void Update() { // DEBUG: Notifies you if state has changed if (previousState != null && previousState != currentState) { Debug.Log("State changed! " + previousState + " -> " + currentState); // Activates start state currentState.StartState(); } // Update current state currentState.UpdateState(); // Update previous state previousState = currentState; }