protected void AddAction(string taskName, object[] args, StateTransitionPhase phase) { EnsureName(); if (CurrentState != null) { CurrentState.AddNewTransitionAction(taskName, phase, args); } else { StateMachine.AddNewTransitionAction(taskName, phase, args); } }