void OnTriggerExit(Collider other) {
   TriggerObject[] tos = other.GetComponents<TriggerObject>();
   for (int i = 0; i < tos.Length; i++) {
     tos[i].TriggerExit();
     if (TriggerContract == tos[i].TriggerContract) {
       OnExit.Invoke();
     }
   }
 }
 void OnTriggerEnter(Collider other) {
   TriggerObject[] tos = other.GetComponents<TriggerObject>();
   for (int i = 0; i < tos.Length; i++) {
     tos[i].TriggerEnter();
     if (TriggerContract == tos[i].TriggerContract) {
       OnEnter.Invoke();
       tos[i].TriggerEnterAccepted();
     } else {
       tos[i].TriggerEnterRejected();
     }
   }
 }
Esempio n. 3
0
 private void Dump(Collider col)
 {
     Debug.Log(col.ToString() + " " + LayerMask.LayerToName(col.gameObject.layer).ToString());
     Debug.Log("========= NORMAL ===========");
     foreach(UnityEngine.Component com in col.GetComponents(typeof(UnityEngine.Component)) )
     {
         Debug.Log(com.ToString());
     }
     Debug.Log("========= PARENT ===========");
     foreach (UnityEngine.Component com in col.GetComponentsInParent(typeof(UnityEngine.Component)))
     {
         Debug.Log(com.ToString());
     }
     Debug.Log("========= CHILDREN ===========");
     foreach (UnityEngine.Component com in col.GetComponentsInChildren(typeof(UnityEngine.Component)))
     {
         Debug.Log(com.ToString());
     }
 }