예제 #1
0
    private void OnTriggerEnter(Collider other)
    {
        AnimActivator anim;

        if (MyGetComponent(other.gameObject, out anim))
        {
            if (anim.triggerReactor)
            {
                anim.SetActiveForAll(true);
                return;
            }
        }

        UsingObject reactor;

        if (MyGetComponent(other.gameObject, out reactor))
        {
            reactor.Use();
            return;
        }


        //LocationReactor reactor;
        //if (MyGetComponent(other.gameObject, out reactor))
        //{
        //    reactor.Use();
        //    return;
        //}

        //MusicChanger changer;
        //if (MyGetComponent(other.gameObject, out changer))
        //{
        //    changer.Use();
        //    return;
        //}

        TurretScript turret;

        if (MyGetComponent(other.gameObject, out turret))
        {
            turret.target = target;
            DeadEvent    += turret.Clear;
            return;
        }

        if (other.tag.Equals("Safe"))
        {
            sampleController.Safe();
            Health = 100;
        }
        if (other.tag.Equals("DeadZone"))
        {
            Dead();
        }
        if (other.tag.Equals("NoSuit"))
        {
            NoSuit();
        }
    }