예제 #1
0
    void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("PowerUp"))
        {
            PowerUp gainedPowerUp = other.GetComponent <PowerUp>();

            // Get the gained power up effect
            gainedPowerUp.AffectPlayer(rootTentacle);

            StartCoroutine("AbsorbingAnimation");

            SelfDestroy otherScript = other.GetComponent <SelfDestroy>();
            otherScript.Death();
        }
        else if (other.CompareTag("BadBacteria"))
        {
            StartCoroutine("AbsorbingAnimation");
            SelfDestroy otherScript = other.GetComponent <SelfDestroy>();
            otherScript.Death();
        }
        else if (other.CompareTag("GoodBacteria"))
        {
            StartCoroutine("AbsorbingAnimation");

            SelfDestroy otherScript = other.GetComponent <SelfDestroy>();
            otherScript.Death();
        }
    }