/// <summary> /// the parent Entity will call this at various times (when removed from a scene, disabled, etc) /// </summary> public virtual void UnregisterColliderWithPhysicsSystem() { if (_isParentEntityAddedToScene && _isColliderRegistered) { Physics.RemoveCollider(this); } _isColliderRegistered = false; }
public void RemoveColliders() { if (_colliders == null) { return; } foreach (var collider in _colliders) { Physics.RemoveCollider(collider); } _colliders = null; }