Exemple #1
0
 void OnTriggerStay(Collider other)
 {
     //Debug.Log(other.gameObject);
     if (other.gameObject.tag == "Player" && UserControl.UseItem)
     {
         GameObject[] phones = GameObject.FindGameObjectsWithTag("Phone");
         foreach (GameObject phone in phones)
         {
             if (!Vector3.Equals(phone.transform.position, gameObject.transform.position))
             {
                 PhoneController p = phone.GetComponent <PhoneController>();
                 audioSource.Stop();
                 p.PlaySoundEffect();
             }
         }
     }
 }