Пример #1
0
    public virtual void StartPhase()
    {
        Debug.Log("starting a boss phase");

        sequenceEnded = false;

        if (eventSequence.Length > 0)
        {
            currentEventId = 0;
            currentEvent   = eventSequence[currentEventId];
            currentEvent.StartEvent();
        }
    }
Пример #2
0
    public virtual void UpdatePhase(bool interrupt)
    {
        bool ret = currentEvent.UpdateEvent();

        if (ret)
        {
            return;
        }

        if (!interrupt)
        {
            if (!sequenceEnded)
            {
                currentEvent.TerminateEvent();
                currentEventId = (currentEventId + 1);

                if (currentEventId < eventSequence.Length)
                {
                    currentEvent = eventSequence[currentEventId];
                    currentEvent.StartEvent();
                }
                else
                {
                    currentEventId = 0;
                    sequenceEnded  = true;
                    currentEvent   = eventsLoop [currentEventId];
                    currentEvent.StartEvent();
                }
            }
            else
            {
                currentEvent.TerminateEvent();
                currentEventId = (currentEventId + 1) % eventsLoop.Length;
                currentEvent   = eventsLoop[currentEventId];
                currentEvent.StartEvent();
            }
        }
        else
        {
            currentEvent.TerminateEvent();
            currentEvent = armAttackEvent;
            currentEvent.StartEvent();
        }
    }