// Update is called once per frame void Update() { if (m_state != EntityState.Alive) { return; } if (m_currentAction != null) { m_currentAction.Update(); if (m_currentAction.IsComplete()) { m_currentAction.End(); m_currentAction = null; if (m_actionQueue.Count > 0) { m_currentAction = m_actionQueue.Dequeue(); m_currentAction.Start(); } } } else { if (m_actionQueue.Count > 0) { m_currentAction = m_actionQueue.Dequeue(); m_currentAction.Start(); } } }