Пример #1
0
    private void OnTriggerExit(Collider other)
    {
        PartTrigger ct = other.attachedRigidbody.gameObject.GetComponent <PartTrigger>();

        if (ct != null)
        {
            rockTrigger = false;
        }
    }
Пример #2
0
    private void OnTriggerExit(Collider other)
    {
        PartTrigger ct = other.attachedRigidbody.gameObject.GetComponent <PartTrigger>();

        if (ct != null)
        {
            anim.SetBool("hasCollider", false);
            lightSource.enabled  = false;
            transform.parent.tag = "Untagged";
        }
    }
Пример #3
0
    private void OnTriggerEnter(Collider other)
    {
        PartTrigger ct = other.attachedRigidbody.gameObject.GetComponent <PartTrigger>();

        if (ct != null)
        {
            anim.SetBool("hasCollider", true);
            ct.triggerPart();
            if (collider != null)
            {
                collider.enabled = false;
            }

            lightSource.enabled = true;
            if (transform.parent != null)
            {
                transform.parent.tag = "Untagged";
            }
        }
    }