public void StopEvent(bool interupted = false)
        {
            //Debug.Log("Stop Cinematic");
            DialogueEvent trigger = current_event;
            current_event = null;
            current_message = null;
            talk_bubble_inst.SetActive(false);
            DialoguePanel.Get().Hide();
            DialogueZoomPanel.Get().Hide();

            if (trigger != null && trigger.camera_lock_on != null)
            {
                FollowCamera pcam = FollowCamera.Get();
                pcam.UnlockCamera();
            }

            if (trigger != null && trigger.zoomed_in)
            {
                //TheGame.Instance.UnlockGameplay();
            }

            if (!interupted && trigger != null)
            {
                trigger.TriggerEffects();
                if (OnDialogueEnd != null)
                {
                    OnDialogueEnd.Invoke(trigger);
                }
                if (trigger.OnEnd != null)
                {
                    trigger.OnEnd.Invoke();
                }
            }
        }
 public void HideDialogue()
 {
     if (DialoguePanel.Get().IsVisible())
     {
         DialoguePanel.Get().Hide();
         talk_bubble_inst.SetActive(false);
     }
 }
        public void StartDialogue(DialogueMessage dialogue)
        {
            //Debug.Log("Start Dialogue " + dialogue_index);
            current_message = dialogue;
            current_actor = dialogue.actor;
            interact_timer = 0f;

            Sprite portrait = default_portrait;
            Sprite portrait_zoom = default_portrait_zoomed;
            string title = "";
            CinematicActorPortrait zoom_portrait = null;
            int side = 1;
            bool flipped = false;
            
            if (current_actor != null)
            {
                portrait = current_actor.portrait;
                portrait_zoom = current_actor.portrait_zoomed;
                zoom_portrait = current_actor.GetPortrait();
                title = current_actor.title;
                side = current_message.side != 0 ? current_message.side : (current_actor.is_player ? -1 : 1);
                flipped = side >= 1;
                talk_bubble_inst.SetActive(true);
            }

            bool display_dialogue = (current_actor != null);
            if (current_event.zoomed_in)
            {
                if (display_dialogue)
                {
                    DialogueZoomPanel.Get().SetDialogue(title, portrait_zoom, zoom_portrait, current_message.text, side, "", flipped);
                    DialogueZoomPanel.Get().Show();
                    //TheGame.Instance.LockGameplay();
                }
            }
            else
            {
                DialoguePanel.Get().Set(portrait, title, current_message.text);
                DialoguePanel.Get().Show();
            }

            if (display_dialogue)
                NarrativeData.Get().AddToHistory(new DialogueMessageData(title, portrait, current_message.text));

            UpdateTalkBubble();
            dialogue_timer = 0f;

            if (audio_source != null && dialogue.voice_clip != null)
                audio_source.PlayOneShot(dialogue.voice_clip, 0.8f);

            if (current_message.OnStart != null)
            {
                current_message.OnStart.Invoke();
            }
        }
        public void StopDialogue()
        {
            HideDialogue();
            DialoguePanel.Get().Hide(true);
            DialogueZoomPanel.Get().Hide();

            if (current_message && current_message.OnEnd != null)
            {
                current_message.OnEnd.Invoke();
            }

            if (current_message)
            {
                current_message.TriggerEffects();
            }

            current_message = null;
            current_actor = null;
            interact_timer = 0f;
        }
Beispiel #5
0
 protected override void Awake()
 {
     base.Awake();
     _instance = this;
 }