예제 #1
0
    public void OnCollisionEnter(Collision other)
    {
        //if dead
        if (transform.parent == null)
        {
            return;
        }

        if (other.gameObject.CompareTag("PlayerBullet"))
        {
            Die();
            other.gameObject.tag = "Untagged";
        }

        if (other.gameObject.CompareTag("ShieldModules"))
        {
            ShieldController shieldController = other.gameObject.GetComponentInParent <ShieldController>();
            if (shieldController != null)
            {
                shieldController.DestroyShield();
            }
        }
    }