コード例 #1
0
 private void Update()
 {
     if (trigger != null && trigger.Done)
     {
         trigger = null;
         CutsceneSpeakController.Instance.SpeechUI.SetActive(true);
         NextEvent();
     }
 }
コード例 #2
0
    public void NextEvent()
    {
        enabled = false;
        if (nextEvent >= Events.Count)
        {
            done = true;
            CutsceneSpeakController.Instance.FinishConversation();
            return;
        }
        CutsceneSpeakEvent current = Events[nextEvent++];

        switch (current.Event)
        {
        case CutsceneSpeakEvent.EventType.AddSpeaker:
            CutsceneSpeakController.Instance.AddSpeaker(current.SpeakerName, current.SpeakerIcon, current.FlipX, current.SpeakerPos, current.Pitch);
            NextEvent();
            break;

        case CutsceneSpeakEvent.EventType.Speak:
            CutsceneSpeakController.Instance.Say(current.SpeakerName, current.Text, current.VoiceOver, this);
            break;

        case CutsceneSpeakEvent.EventType.MoveSpeaker:
            CutsceneSpeakController.Instance.MoveSpeaker(current.SpeakerName, current.SpeakerPos, current.FlipX, this);
            break;

        case CutsceneSpeakEvent.EventType.RemoveSpeaker:
            CutsceneSpeakController.Instance.RemoveSpeaker(current.SpeakerName);
            NextEvent();
            break;

        case CutsceneSpeakEvent.EventType.ActivateTrigger:
            current.Trigger.Activate();
            if (current.Trigger is ContinuousTrigger)
            {
                trigger = (ContinuousTrigger)current.Trigger;
                enabled = true;
                CutsceneSpeakController.Instance.SpeechUI.SetActive(false);
            }
            else
            {
                NextEvent();
            }
            break;

        default:
            break;
        }
        return;
    }