Pathfinding.RecastBBTree.QueryInBounds C# (CSharp) Method

QueryInBounds() public method

public QueryInBounds ( Rect bounds, List buffer ) : void
bounds UnityEngine.Rect
buffer List
return void
		public void QueryInBounds (Rect bounds, List<RecastMeshObj> buffer) {
			RecastBBTreeBox c = root;

			if (c == null) return;

			QueryBoxInBounds(c, bounds, buffer);
		}

Usage Example

Ejemplo n.º 1
0
 public static void GetAllInBounds(List <RecastMeshObj> buffer, Bounds bounds)
 {
     if (!Application.isPlaying)
     {
         RecastMeshObj[] objArray = UnityEngine.Object.FindObjectsOfType(typeof(RecastMeshObj)) as RecastMeshObj[];
         for (int i = 0; i < objArray.Length; i++)
         {
             objArray[i].RecalculateBounds();
             if (objArray[i].GetBounds().Intersects(bounds))
             {
                 buffer.Add(objArray[i]);
             }
         }
     }
     else
     {
         if (Time.timeSinceLevelLoad == 0f)
         {
             RecastMeshObj[] objArray2 = UnityEngine.Object.FindObjectsOfType(typeof(RecastMeshObj)) as RecastMeshObj[];
             for (int k = 0; k < objArray2.Length; k++)
             {
                 objArray2[k].Register();
             }
         }
         for (int j = 0; j < dynamicMeshObjs.Count; j++)
         {
             if (dynamicMeshObjs[j].GetBounds().Intersects(bounds))
             {
                 buffer.Add(dynamicMeshObjs[j]);
             }
         }
         Rect rect = Rect.MinMaxRect(bounds.min.x, bounds.min.z, bounds.max.x, bounds.max.z);
         tree.QueryInBounds(rect, buffer);
     }
 }
All Usage Examples Of Pathfinding.RecastBBTree::QueryInBounds