public static IgnorableRigidbody GetIgnorableCollision(Rigidbody rb) { if (rb == null) { return(null); } return(rb.AddOrGetComponent <IgnorableRigidbody>()); }
public static void AddOnTriggerExitCallback(this Rigidbody rb, TriggerEventCallback callback) { if (rb == null || callback == null) { return; } var handle = rb.AddOrGetComponent <OnTriggerExitCallbackHandle>(); handle.TriggerExited += callback; }