Pathfinding.RecastBBTree.Remove C# (CSharp) Method

Remove() public method

public Remove ( RecastMeshObj mesh ) : bool
mesh RecastMeshObj
return bool
		public bool Remove (RecastMeshObj mesh) {
			if (mesh == null) throw new ArgumentNullException("mesh");

			if (root == null) {
				return false;
			}

			bool found = false;
			Bounds b = mesh.GetBounds();
			//Convert to top down rect
			Rect r = Rect.MinMaxRect(b.min.x, b.min.z, b.max.x, b.max.z);

			root = RemoveBox(root, mesh, r, ref found);

			return found;
		}

Usage Example

Ejemplo n.º 1
0
 private void OnDisable()
 {
     this.registered = false;
     if (this._dynamic)
     {
         dynamicMeshObjs.Remove(this);
     }
     else if (!tree.Remove(this))
     {
         throw new Exception("Could not remove RecastMeshObj from tree even though it should exist in it. Has the object moved without being marked as dynamic?");
     }
     this._dynamic = this.dynamic;
 }