private static void SetNavMeshArea(int area, bool includeChildren) { List <GameObject> objects = NavMeshEditorWindow.GetObjects(includeChildren); if (objects.Count > 0) { Undo.RecordObjects(objects.ToArray(), "Change NavMesh area"); foreach (GameObject current in objects) { GameObjectUtility.SetNavMeshArea(current, area); } } }
static void SetNavMeshArea(int area, bool includeChildren) { var objects = GetObjects(includeChildren); if (objects.Count <= 0) { return; } Undo.RecordObjects(objects.ToArray(), "Change NavMesh area"); foreach (var go in objects) { GameObjectUtility.SetNavMeshArea(go, area); } }
private static void SetNavMeshArea(int area, bool includeChildren) { List <GameObject> objects = NavMeshEditorWindow.GetObjects(includeChildren); if (objects.Count <= 0) { return; } Undo.RecordObjects((UnityEngine.Object[])objects.ToArray(), "Change NavMesh area"); using (List <GameObject> .Enumerator enumerator = objects.GetEnumerator()) { while (enumerator.MoveNext()) { GameObjectUtility.SetNavMeshArea(enumerator.Current, area); } } }
public static void SetNavMeshLayer(GameObject go, int areaIndex) { GameObjectUtility.SetNavMeshArea(go, areaIndex); }