예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        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);
                }
            }
        }