예제 #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.CompareTag("DialogueSpeaker"))
        {
            DialogueSpeaker speaker = collision.GetComponent <DialogueSpeaker>();
            if (speaker.spoken)
            {
                return;
            }

            LevelController.ShowDialogue();
            DialogueScript.ChangeDialogueSpeaker(speaker.speakerName);
            DialogueScript.ChangeDialogueText(speaker.dialogueNumber, speaker.dialogueText);

            speaker.spoken = true;
        }
        else if (collision.CompareTag("Win"))
        {
            // Win Screen

            // After Win Screen back to menu?
            Game.WinGame();
        }
    }