static UJTrigger GetTrigger(GameObject gameObject) { UJTrigger trgr = gameObject.GetComponent <UJTrigger>(); if (trgr == null) { trgr = gameObject.AddComponent <UJTrigger>(); } // trgr.hideFlags = HideFlags.HideInInspector; return(trgr); }
public static void OnTriggerExit(this Rigidbody rigidbody, Action <Collider> trigger) { UJTrigger trgr = GetTrigger(rigidbody.gameObject); trgr.exit = trigger; }
public static void OnTriggerExit(this Collider col, Action <Collider> trigger) { UJTrigger trgr = GetTrigger(col.gameObject); trgr.exit = trigger; }