// Update is called once per frame void Update() { if (m_previousState != null && m_previousState != m_currentState) { Debug.Log("Coily state changed! " + m_previousState + " -> " + m_currentState); // Initiate start m_currentState.StartState(); } m_currentState.UpdateState(); m_previousState = m_currentState; }
// Update is called once per frame void Update() { m_currentState.UpdateState(); if (m_previousState != null && m_previousState != m_currentState) { Debug.Log("RedBlob state changed! " + m_previousState + " -> " + m_currentState); // Initiate start method m_currentState.StartState(); } m_previousState = m_currentState; }