Ejemplo n.º 1
0
    private void QueueAction(BaseAction action)
    {
        if (action == null)
            return;

        if (currentAction == null && action.CooldownReady() && !action.IsDisabled())
        {
            currentAction = action;
            nextAction = null;
            currentAction.Execute();
        }
        else if (action.IsQueueable())
        {
            if (currentAction == action && currentAction.IsMultiStep())
            {
                currentAction.QueueNextStep();
                nextAction = null;
            }
            else
            {
                nextAction = action;

                if (currentAction != null && currentAction.IsMultiStep())
                {
                    currentAction.CancelNextStep();
                }
            }
        }
    }