Exemplo n.º 1
0
    // 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;
            }
        }
    }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
 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();
 }