示例#1
0
 public string GetNextSpeaker(NewDialogue dialogue)
 {
     if (dialogue.nextDialogueSpeaker == "")
     {
         return(null);
     }
     return(dialogue.nextDialogueSpeaker);
 }
示例#2
0
    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
    }
示例#3
0
    public NewDialogue GetNextSpeakerDialogue(NewDialogue dialogue)
    {
        if (dialogue.nextDialogueSpeaker == null)
        {
            return(null);
        }

        return(GetSpeakerDialogue(DialogueScript.level, dialogue.nextDialogueSpeaker, dialogue.nextDialogueNumber));
    }
示例#4
0
    public void StartDialogue(NewDialogue dialogue)
    {
        NameText.text = dialogue.Name[0];
        IsTalking     = true;
        Sentences.Clear();

        foreach (string Sentence in dialogue.Sentences)
        {
            Sentences.Enqueue(Sentence);
        }
        DisplayNextSentence();
    }
示例#5
0
 void Start()
 {
     dialogue = GetComponent <NewDialogue> ();
 }
示例#6
0
 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
 }
示例#7
0
 /// <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);
 }