public void StartConversation(TextAsset dialogue, Vector3 speakerPosition, Transform cameraPosition = null, AfterDialogueEvent afterEvent = null) { DialogueEngine.InitializeGenerators(SpeakingLine.CreateSpeakingLine, InstructionLine.CreateInstructionLine); List <ScriptLine> lines = DialogueEngine.CreateDialogueComponents(dialogue.text); Dialogue processedDialogue = new Dialogue(lines); StartCoroutine(PlayConversation(processedDialogue, cameraPosition, afterEvent)); }
public void StartConversation(TextAsset dialogue, Vector3 focusPosition, Transform playerPosition = null, Transform cameraPosition = null, AfterDialogueEvent afterEvent = null, List <DialogueInstruction> AvailableInstructions = null) { DialogueEngine.InitializeGenerators(SpeakingLine.CreateSpeakingLine, ExpressionLine.CreateInstructionLine, ChoiceLine.GenerateChoiceLine, InstructionLine.GenerateInstructionline, StallLine.GenerateStallLine, ReisenGameManager.instance.ConditionsSatisfied); List <ScriptLine> lines = DialogueEngine.CreateDialogueComponents(dialogue.text, AvailableInstructions); HashSet <string> speakers = new HashSet <string>(lines.Select(x => x.speaker).Distinct()); Dialogue processedDialogue = new Dialogue(lines, speakers); StartCoroutine(PlayConversation(processedDialogue, focusPosition, playerPosition, cameraPosition, afterEvent)); }
// Start is called before the first frame update void Start() { DialogueEngine.InitializeGenerators(CutsceneSpeakingLine.CreateSpeakingLine, ExpressionLine.CreateInstructionLine, ChoiceLine.GenerateChoiceLine, InstructionLine.GenerateInstructionline, StallLine.GenerateStallLine, (x) => true); List <ScriptLine> lines = DialogueEngine.CreateDialogueComponents(dialogueTextAsset.text, AvailableInstructions); HashSet <string> speakers = new HashSet <string>(lines.Select(x => x.speaker).Distinct()); dialogue = new Dialogue(lines, speakers); if (playOnAwake) { StartCoroutine(PlayCutscene()); } }