public void Update() { CheckInput(); currentAction = currentAction ?? Dequeue(); if (currentAction != null) { CharacterActionStatus actionStatus = currentAction.OnUpdate(); switch (actionStatus) { case CharacterActionStatus.Running: break; case CharacterActionStatus.Cancelled: currentAction.OnCancel(); currentAction.OnCleanup(); currentAction = null; break; case CharacterActionStatus.Completed: currentAction.OnComplete(); currentAction.OnCleanup(); currentAction = null; break; } } }