Пример #1
0
    void Update()
    {
        if (currentAction == null && actionQueue.Count != 0)
        {
            currentAction = actionQueue.Dequeue();
            SpawnCombatText(currentAction.ToString());
        }

        if (currentAction != null)
        {
            CharacterActionStatus actionStatus = currentAction.OnUpdate();

            switch (actionStatus)
            {
            case CharacterActionStatus.Running:
                break;

            case CharacterActionStatus.Cancelled:
                currentAction.OnCancel();
                currentAction.OnCleanup();
                currentAction = null;
                break;

            case CharacterActionStatus.Completed:
                currentAction.OnComplete();
                currentAction.OnCleanup();
                currentAction = null;
                break;
            }
        }
        else
        {
        }
    }