public void SetCurrentAction(IAction newAction) { if (currentAction != null) { currentAction.Cancel(); } currentAction = newAction; currentAction.Begin(); }
void Update() { MovePlayer(); if (activeAction != null) { RunAction(activeAction); } if (activeAction == null && actions.Count > 0) { IAction nextAction = actions.Dequeue(); activeAction = nextAction; activeAction.Begin(); } }