// returns true if the dialogue should block entry private bool GetDialogueForState(GameStateData state, out SerializedDialogue res) { Func <LocationDialogueForState, bool> filter = (LocationDialogueForState dialogue) => dialogue.gameStateData == state; res = entryDialogue.FirstOrDefault(filter)?.locationDialogue; if (res != null) { return(false); } res = uniqueStateBlockingDialogue.FirstOrDefault(filter)?.locationDialogue; if (res != null) { return(true); } if (defaultBlockingDialogue.Count > 0) { int index = ((defaultDialogueIdx + 1) < defaultBlockingDialogue.Count) ? defaultDialogueIdx++ : (defaultBlockingDialogue.Count - 1); res = defaultBlockingDialogue[index]; return(true); } return(false); }
private void HandleDialogue(SerializedDialogue dialogue, bool enter) { enterIndicator.FadeOut(); runningDialogue = true; dialogueManager.StartDialogue(dialogue.dialogue, DialogueType.SPEECH, player.PlayerTransform, this, () => CompleteDialogue(enter)); }