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);
}
}