//tells Diallogue Manager to start at this NPC's node private void StartDialogue() { //START DIALOGUE if (shouldIncrementSuffix) { if (nodeSuffix > maxNodeSuffix) { nodeSuffix = maxNodeSuffix; } dialogueManager.BeginDialogue(); dialogueManager.dialogueRunner.StartDialogue(yarnStartNode + nodeSuffix); if (nodeSuffix < maxNodeSuffix) { nodeSuffix++; } } else { dialogueManager.BeginDialogue(); dialogueManager.dialogueRunner.StartDialogue(yarnStartNode + "1"); } }
void Update() { Vector3 cameraTarget = (Show) ? ShownPos : HiddenPos; rect.anchoredPosition = Vector2.Lerp(rect.anchoredPosition, cameraTarget, MoveTime); if (Show && Vector3.Distance(rect.anchoredPosition, cameraTarget) < 10f && !beginningDialogue) { dMan.BeginDialogue(); beginningDialogue = true; } else if (!Show) { beginningDialogue = false; } }
//call this method from anywhere to trigger the dialogue tied to this specific object public void Trigger() { dm.BeginDialogue(dialogue); }