コード例 #1
0
ファイル: Dialog.cs プロジェクト: ethanrwilson1998/The-Rock
 public void EnableDialogBox()
 {
     if (instance.ButtonsOn())
     {
         return;
     }
     Show();
     if (OnDialogueStart != null)
     {
         OnDialogueStart.Invoke();
     }
     title.text = instance.getSpeakerName();
     instance.DisableButtons();
     OnBoxClicked();
 }
コード例 #2
0
		public void StartDialogue()
		{
			OnDialogueStart?.Invoke();

			if(isActive)
				EndDialogue();

            if(pauseDuringDialogue)
			    Time.timeScale = 0f;

			foreach(var line in dialogue.lines)
				dialogueLines.Enqueue(line);

			isActive = true;
			dialogueBox.SetActive(true);
			StartCoroutine("NextLine");

		}
コード例 #3
0
        public void StartDialogue(Dialogue dialogue)
        {
            if (hasStarted)
            {
                DisplayNexSentences();
                return;
            }

            OnDialogueStart?.Invoke();

            hasStarted = true;

            dialoguePanel.gameObject.SetActive(true);
            dialoguePanel.npcNameText.SetText(dialogue.NameNPC());

            sentences.Clear();

            foreach (var sentence in dialogue.Sentences())
            {
                sentences.Enqueue(sentence);
            }

            DisplayNexSentences();
        }
コード例 #4
0
        /// <summary>
        ///     Starts the dialogue by adding all the dialogue lines from the current dialogue object to a Queue, calls the OnDialogueStart event, pauses the game (if the setting is active) and enables the dialogue box.
        ///     This overload is supposed to be used when there is a default dialogue sequence, since it uses the last set dialogue as the current dialogue.
        ///     Otherwise, use the StartDialogue(Dialogue dialogue) overload.
        /// </summary>
        public void StartDialogue(Agent _agent = null, FinalInferno.Movable _movingAgent = null)
        {
            // If an agent or movable is passed as parameter, they must have interactions and movement blocked
            if (_agent)
            {
                agent             = _agent;
                agent.canInteract = false;
            }
            if (_movingAgent)
            {
                movingAgent = _movingAgent;
                FinalInferno.CharacterOW.PartyCanMove = false;
                //movingAgent.CanMove = false;
            }

            OnDialogueStart?.Invoke();

            if (isActive)
            {
                EndDialogue();
            }

            if (pauseDuringDialogue)
            {
                Time.timeScale = 0f;
            }

            foreach (var line in dialogue.lines)
            {
                dialogueLines.Enqueue(line);
            }

            isActive = true;
            dialogueBox.gameObject.SetActive(true);
            StartCoroutine("NextLine");
        }
コード例 #5
0
 public override void SelectNode(GameObject user)
 {
     OnDialogueStart?.Invoke(messages, choices, user);
 }