コード例 #1
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        LinkController controller = other.GetComponent <LinkController>();

        if (controller != null && collectible)
        {
            Destroy(gameObject);

            controller.PlaySound(collected);
            controller.CollectBow();
        }
    }
コード例 #2
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        LinkController controller = other.GetComponent <LinkController>();

        if (controller != null && collectible)
        {
            controller.ChangeTriforceCount(1);

            winScreen.GetComponent <WinScreenTextController>().go = true;
            Destroy(rest);
            Destroy(gameObject);

            controller.PlaySound(collected);
        }
    }
コード例 #3
0
        private void OnTriggerEnter2D(Collider2D other)
        {
            LinkController controller = other.GetComponent <LinkController>();

            if (controller != null && collectible)
            {
                if (controller.life < controller.maxLife)
                {
                    controller.ChangeHealth(amount);

                    Destroy(gameObject);

                    controller.PlaySound(collected);
                }
            }
        }
コード例 #4
0
ファイル: Compass.cs プロジェクト: GhostSpite/ZeldaUnity
    private void OnTriggerEnter2D(Collider2D other)
    {
        LinkController controller = other.GetComponent <LinkController>();

        if (controller != null && collectible)
        {
            triforceIcon.SetActive(true);
            linkIcon.SetActive(true);

            controller.CollectCompass();

            Destroy(gameObject);

            controller.PlaySound(collected);
        }
    }