Пример #1
0
    void OnCollisionStay()
    {
        // Change texture
        renderer.material.mainTexture = buttonOn;

        // Lower the fence
        fenceController.setFenceUp(false);

        triggerActive = true;
    }
Пример #2
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.Equals(targetPipe))
     {
         GetComponent <Animator>().SetBool("hasPipe", true);
         Destroy(other.gameObject);            //.SetActive(false);
         fenceController.setFenceUp(false);
         AudioSource.PlayClipAtPoint(attachClip, transform.position);
         AudioSource.PlayClipAtPoint(happyRobot, transform.position);
     }
 }