Example #1
0
 private void OnTriggerExit(Collider other)
 {
     if (other.gameObject.CompareTag(GameData.Layers.Cucaracha.ToString()) && lightOn)
     {
         CucarachaController cuca = other.gameObject.GetComponent <CucarachaController>();
         if (cuca == null)
         {
             cuca = other.transform.parent.GetComponent <CucarachaController>();
         }
         cuca.SetInsideLamp(false, null);
         cucaInside.Remove(cuca);
     }
 }
Example #2
0
 private void OnTriggerStay(Collider other)
 {
     if (other.gameObject.CompareTag(GameData.Layers.Cucaracha.ToString()) && lightOn)
     {
         CucarachaController cuca = other.gameObject.GetComponent <CucarachaController>();
         if (cuca == null)
         {
             cuca = other.transform.parent.GetComponent <CucarachaController>();
         }
         cuca.SetInsideLamp(true, this);
         if (!cucaInside.Contains(cuca))
         {
             cucaInside.Add(cuca);
         }
     }
 }