Example #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Projectile")
        {
            TakeDamage(10);

            LaserBoltController laserBolt = other.gameObject.GetComponentInParent <LaserBoltController>();
            if (laserBolt)
            {
                laserBolt.Explode();
            }
        }
    }
Example #2
0
    void OnTriggerEnter(Collider other)
    {
        if (mIsOn)
        {
            if (other.tag == "Projectile")
            {
                LaserBoltController laserBolt = other.gameObject.GetComponentInParent <LaserBoltController>();
                laserBolt.Reflect();

                mAudioSource.PlayOneShot(BladeReflectSound);
            }

            Destroyable destroyable = other.gameObject.GetComponent <Destroyable>();
            if (destroyable)
            {
                destroyable.Destroyed();
            }
        }
    }
Example #3
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "Projectile")
        {
            //Explode();

            LaserBoltController laserBolt = other.gameObject.GetComponentInParent <LaserBoltController>();
            if (laserBolt)
            {
                laserBolt.Explode();
            }
        }
        else if (other.gameObject.tag == "Player")
        {
            Explode();

            BodyController controller = other.gameObject.GetComponent <BodyController>();
            if (controller)
            {
                controller.TakeDamage(10);
            }
        }
    }