void OnTriggerEnter2D(Collider2D colli)
        {
            if (colli.CompareTag("Doggo"))
            {
                SoundManager.instance.musicSource.PlayOneShot(doggo, 1.0f);

                dialog.text = DialogScript.getDialog(int.Parse(colli.gameObject.name));

                StatKeeper.DoggoDiscovered(int.Parse(colli.gameObject.name));
            }

            if (colli.CompareTag("NPC"))
            {
                dialog.text = DialogScript.getDialog(int.Parse(colli.gameObject.name));
            }
            else if (colli.CompareTag("HostileNPC") == true)
            {
                StatKeeper.receiveDamage(2);
            }
            else if (colli.CompareTag("YellowKnight") == true)
            {
                if (YellowKnightToggle.activeSelf == false)
                {
                    SoundManager.instance.musicSource.PlayOneShot(yellowKnight, 1.0f);

                    toggleFathers();

                    YellowKnightToggle.SetActive(true);
                }
            }
            else if (colli.CompareTag("BlueKnight") == true)
            {
                if (BlueKnightToggle.activeSelf == false)
                {
                    SoundManager.instance.musicSource.PlayOneShot(blueKnight, 1.0f);

                    toggleFathers();

                    BlueKnightToggle.SetActive(true);
                }
            }
            else if (colli.CompareTag("BloodyKnight") == true)
            {
                if (BloodyKnightToggle.activeSelf == false)
                {
                    SoundManager.instance.musicSource.PlayOneShot(bloodyKnight, 1.0f);

                    toggleFathers();

                    BloodyKnightToggle.SetActive(true);
                }
            }
            else
            {
                toggleFathers();

                dialog.text = DialogScript.getNullDialog();
            }
        }
Example #2
0
        void OnTriggerEnter2D(Collider2D colli)
        {
            if (colli.CompareTag("NPC"))
            {
                dialog.text = DialogScript.getDialog(int.Parse(colli.gameObject.name));

                /*}else if (colli.CompareTag("Wench")) {
                 * dialog.text = DialogScript.getDialog(int.Parse(colli.gameObject.name));
                 */
            }
            else if (colli.CompareTag("HiddenHoboCoin") == true)
            {
                Debug.Log("Oh look, a HoboCoin !");

                StatKeeper.collectHoboCoin();
            }
            else if (colli.CompareTag("HostileNPC") == true)
            {
                StatKeeper.receiveDamage(2);
            }
            else if (colli.CompareTag("YellowKnight") == true)
            {
                if (YellowKnightToggle.activeSelf == false)
                {
                    YellowKnightToggle.SetActive(true);
                }
            }
            else if (colli.CompareTag("BlueKnight") == true)
            {
                if (BlueKnightToggle.activeSelf == false)
                {
                    BlueKnightToggle.SetActive(true);
                }
            }
            else if (colli.CompareTag("BloodyKnight") == true)
            {
                if (BloodyKnightToggle.activeSelf == false)
                {
                    BloodyKnightToggle.SetActive(true);
                }
            }
            else
            {
                dialog.text = DialogScript.getNullDialog();
            }
        }