public string GetNextSpeaker(NewDialogue dialogue) { if (dialogue.nextDialogueSpeaker == "") { return(null); } return(dialogue.nextDialogueSpeaker); }
private void Start() { instance = this; dialogueText = GameObject.Find("DialogueText").GetComponent <Text>(); // FINDS THE DIALOGUETEXT COMPONENT IN THE SCENE dialogueBox = GameObject.Find("DialogueBox"); // FINDS THE DIALOGUE BOX GAMEOBJECT IN THE SCENE loadTextFile(); // CALLS THE LOADTEXTFILE METHOD WHICH LOADS IN THE REQUESTED FILE FROM THE RESOURCES FOLDER }
public NewDialogue GetNextSpeakerDialogue(NewDialogue dialogue) { if (dialogue.nextDialogueSpeaker == null) { return(null); } return(GetSpeakerDialogue(DialogueScript.level, dialogue.nextDialogueSpeaker, dialogue.nextDialogueNumber)); }
public void StartDialogue(NewDialogue dialogue) { NameText.text = dialogue.Name[0]; IsTalking = true; Sentences.Clear(); foreach (string Sentence in dialogue.Sentences) { Sentences.Enqueue(Sentence); } DisplayNextSentence(); }
void Start() { dialogue = GetComponent <NewDialogue> (); }
private void saveCurrentDialogueIndex() { currentDialogueIndex = NewDialogue.getCurrentDialogueIndex(); // SETS THE CURRENTDIALOGUEINDEX TO THE LAST INDEX OF THE ARRAY character = NewDialogue.getCharacter(); // SETS THE CHARACTER STRING TO THE CURRENT CHARACTER IN THE GAME }
/// <summary> /// call dialogue event when interacting with npc /// </summary> /// <param name="id">the id of the character</param> /// <param name="msg">the message from the character</param> public void OnCharacterInteract(NPC id, string msg) { NewDialogue?.Invoke(id, msg); }