Example #1
0
    public DialogueNodeAsset GetDialogueNodeForType(DialogueNodeAsset.DialogueType DialogueType)
    {
        DialogueNodeAsset dialogueNode = null;

        switch (DialogueType)
        {
        case DialogueNodeAsset.DialogueType.Bio:
            dialogueNode = BioDialogue;
            break;

        case DialogueNodeAsset.DialogueType.Spawn:
            dialogueNode = SpawnDialogue;
            break;

        case DialogueNodeAsset.DialogueType.Midrun:
            dialogueNode = MidrunDialogue;
            break;

        case DialogueNodeAsset.DialogueType.AtFork:
            dialogueNode = AtForkDialogue;
            break;

        case DialogueNodeAsset.DialogueType.Die:
            dialogueNode = DieDialogue;
            break;

        case DialogueNodeAsset.DialogueType.Love:
            dialogueNode = LoveDialogue;
            break;

        default:
            throw new System.Exception("Unimplemented type" + DialogueType);
        }
        return(dialogueNode);
    }
Example #2
0
    public void StartDialogue(DialogueNodeAsset.DialogueType DialogueType)
    {
        Speaker speaker = PlayerController.Instance.gameObject.GetComponent <Speaker>();

        asset = speaker.GetDialogueNodeForType(DialogueType);
        CurrentDialogueType = DialogueType;
        AdjustTextSizeForDialogueType((DialogueNodeAsset.DialogueType)CurrentDialogueType);
        spacebarHintText.enabled = IsCurrentDialogueBioOrDeath();
        sentenceQueue.Clear();

        foreach (string sentence in asset.sentences)
        {
            sentenceQueue.Enqueue(sentence);
        }
        DisplayNextSentence();
    }