// Method to start next action void GotoNextAction() { while (true) { // If there's still more actions to do if (actionIndex_ + 1 < runTimeActionList_.Count) { // Increment action index to next action actionIndex_++; // Set current action to next action BaseAction nextAction = runTimeActionList_[actionIndex_]; nextAction.Begin(this); activeActions_.Add(nextAction); if (nextAction.isBlocking_) { blocked_ = true; break; } } else if (activeActions_.Count <= 0) { // Else no more actions left, end the event eventRunning_ = false; break; } else { break; } } }
private void BeginAction(BaseAction action) { var modeAction = action as ModeAction; if (modeAction != null) { if (modeAction.IsActivate) { ActivateMode(modeAction.ModeName); } else { DeactivateMode(modeAction.ModeName); } } else { action.Begin(); } }
public bool StartAction(BaseAction newAction) { if (newAction != null) { if (blocked_) { runTimeActionList_.Insert(actionIndex_ + 1, newAction); Debug.Log(runTimeActionList_); return(false); } else { newAction.Begin(this); activeActions_.Add(newAction); if (newAction.isBlocking_) { blocked_ = true; } } } return(true); }
private void BeginAction(BaseAction action) { var modeAction = action as ModeAction; if (modeAction != null) { if (modeAction.IsActivate) ActivateMode(modeAction.ModeName); else DeactivateMode(modeAction.ModeName); } else action.Begin(); }