예제 #1
0
        private static void ObjectSettings()
        {
            bool flag = true;

            SceneModeUtility.SearchBar(new Type[]
            {
                typeof(MeshRenderer),
                typeof(Terrain)
            });
            EditorGUILayout.Space();
            GameObject[]   array;
            MeshRenderer[] selectedObjectsOfType = SceneModeUtility.GetSelectedObjectsOfType <MeshRenderer>(out array, new Type[0]);
            if (array.Length > 0)
            {
                flag = false;
                NavMeshEditorWindow.ObjectSettings(selectedObjectsOfType, array);
            }
            Terrain[] selectedObjectsOfType2 = SceneModeUtility.GetSelectedObjectsOfType <Terrain>(out array, new Type[0]);
            if (array.Length > 0)
            {
                flag = false;
                NavMeshEditorWindow.ObjectSettings(selectedObjectsOfType2, array);
            }
            if (flag)
            {
                GUILayout.Label("Select a MeshRenderer or a Terrain from the scene.", EditorStyles.helpBox, new GUILayoutOption[0]);
            }
        }
        public void OnGUI()
        {
            if (this.m_Object.targetObject == null)
            {
                this.Init();
            }
            if (NavMeshEditorWindow.s_Styles == null)
            {
                NavMeshEditorWindow.s_Styles = new NavMeshEditorWindow.Styles();
            }
            this.m_Object.Update();
            EditorGUILayout.Space();
            this.ModeToggle();
            EditorGUILayout.Space();
            this.m_ScrollPos = EditorGUILayout.BeginScrollView(this.m_ScrollPos, new GUILayoutOption[0]);
            switch (this.m_Mode)
            {
            case NavMeshEditorWindow.Mode.ObjectSettings:
                NavMeshEditorWindow.ObjectSettings();
                break;

            case NavMeshEditorWindow.Mode.BakeSettings:
                this.BakeSettings();
                break;

            case NavMeshEditorWindow.Mode.AreaSettings:
                this.AreaSettings();
                break;
            }
            EditorGUILayout.EndScrollView();
            NavMeshEditorWindow.BakeButtons();
            this.m_Object.ApplyModifiedProperties();
        }
예제 #3
0
 public void OnGUI()
 {
     EditorGUILayout.Space();
     this.ModeToggle();
     EditorGUILayout.Space();
     this.InitProjectSettings();
     this.m_ScrollPos = EditorGUILayout.BeginScrollView(this.m_ScrollPos, new GUILayoutOption[0]);
     NavMeshEditorWindow.Mode mode = this.m_Mode;
     if (mode != NavMeshEditorWindow.Mode.ObjectSettings)
     {
         if (mode != NavMeshEditorWindow.Mode.SceneBakeSettings)
         {
             if (mode == NavMeshEditorWindow.Mode.AreaSettings)
             {
                 this.AreaSettings();
             }
         }
         else
         {
             this.SceneBakeSettings();
         }
     }
     else
     {
         NavMeshEditorWindow.ObjectSettings();
     }
     EditorGUILayout.EndScrollView();
     NavMeshEditorWindow.BakeButtons();
 }
예제 #4
0
        private static void ObjectSettings()
        {
            bool flag = true;

            SceneModeUtility.SearchBar(typeof(MeshRenderer), typeof(Terrain));
            EditorGUILayout.Space();
            GameObject[]   gameObjects;
            MeshRenderer[] selectedObjectsOfType1 = SceneModeUtility.GetSelectedObjectsOfType <MeshRenderer>(out gameObjects);
            if (gameObjects.Length > 0)
            {
                flag = false;
                NavMeshEditorWindow.ObjectSettings((UnityEngine.Object[])selectedObjectsOfType1, gameObjects);
            }
            Terrain[] selectedObjectsOfType2 = SceneModeUtility.GetSelectedObjectsOfType <Terrain>(out gameObjects);
            if (gameObjects.Length > 0)
            {
                flag = false;
                NavMeshEditorWindow.ObjectSettings((UnityEngine.Object[])selectedObjectsOfType2, gameObjects);
            }
            if (!flag)
            {
                return;
            }
            GUILayout.Label("Select a MeshRenderer or a Terrain from the scene.", EditorStyles.helpBox, new GUILayoutOption[0]);
        }