removeCollider() public static method

removes the collider from the physics system
public static removeCollider ( Collider collider ) : void
collider Collider Collider.
return void
示例#1
0
文件: Collider.cs 项目: Pyxlre/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)
     {
         Physics.removeCollider(this, true);
     }
 }
示例#2
0
 /// <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;
        }