private void DisplayNextSentence() { if (!ContainNextDialogue()) { if (player != null) { dialogueEntity2.gameObject.GetComponent <Collider2D>().enabled = false; dialogueEntity2.gameObject.GetComponent <Rigidbody2D>().gravityScale = 0; dialogueEntity1.DisplaySentence(""); player.SetDirection(GlobalManager.Instance.gameDirection); IsInDialogue = false; player.isTalking = false; enemy.isTalking = false; ClearEntities(); } return; } string sentence = sentences.Dequeue(); dialogueEntity1.ClearText(); dialogueEntity2.ClearText(); if (firstPerson) { dialogueEntity1.DisplaySentence(sentence); } else { dialogueEntity2.DisplaySentence(sentence); } firstPerson = !firstPerson; }
public void SetDialogueEntities(MovableEntity d1, MovableEntity d2) { player = d1; enemy = d2; dialogueEntity1 = d1.gameObject.GetComponent <DialogueEntity>(); dialogueEntity2 = d2.gameObject.GetComponent <DialogueEntity>(); d1.isTalking = true; d2.isTalking = true; d1.SetDirection(Direction.IDLE); d2.SetDirection(Direction.IDLE); StartDialogue(); }