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