// Use this for initialization void Start() { m_currentState = m_enterState; if (!m_chaseTarget) { m_chaseTarget = GameObject.FindGameObjectWithTag("Player").transform; } m_mapManager = MapManager.instance; }
// 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; }
// 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; }
// Use this for initialization void Start() { m_currentState = m_enterState; m_mapManager = MapManager.instance; }