예제 #1
0
    void StartEvent()
    {
        if (eventRoutine != null)
        {
            curAI.StopCoroutine(eventRoutine);
        }
        if (repeatRoutine != null)
        {
            curAI.StopCoroutine(repeatRoutine);
        }

        eventRoutine = curAI.StartCoroutine(StartTriggerEvent());
    }
예제 #2
0
    public void DoEvent(UnitAITrigger _trigger, int _index, Collider _col = null)
    {
        curAI = _trigger.CurAi;
        if (!equip)
        {
            equip = curAI.GetComponent <UnitEquip>();
        }
        index    = _index;
        finished = false;

        if (_col)
        {
            curTarget = _col;
        }

        if (startType == StartType.Instant)
        {
            StartEvent();
        }
        else if (startType == StartType.WaitForPreviousToFinish && index > 0)
        {
            if (waitRoutine != null)
            {
                curAI.StopCoroutine(waitRoutine);
            }

            waitRoutine = curAI.StartCoroutine(StartWaitForPrevious(_trigger));
        }
    }