示例#1
0
文件: Collider.cs 项目: nikarh/Nez
 /// <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;
 }
示例#2
0
        public void RemoveColliders()
        {
            if (_colliders == null)
            {
                return;
            }

            foreach (var collider in _colliders)
            {
                Physics.RemoveCollider(collider);
            }
            _colliders = null;
        }