private static void ObjectSettings() { bool emptySelection = true; GameObject[] gos; SceneModeUtility.SearchBar(typeof(MeshRenderer), typeof(Terrain)); EditorGUILayout.Space(); MeshRenderer[] renderers = SceneModeUtility.GetSelectedObjectsOfType <MeshRenderer>(out gos); if (gos.Length > 0) { emptySelection = false; ObjectSettings(renderers, gos); } Terrain[] terrains = SceneModeUtility.GetSelectedObjectsOfType <Terrain>(out gos); if (gos.Length > 0) { emptySelection = false; ObjectSettings(terrains, gos); } if (emptySelection) { GUILayout.Label("Select a MeshRenderer or a Terrain from the scene.", EditorStyles.helpBox); } }
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]); } }
private void CameraSelectionGUI() { SceneModeUtility.SearchBar(new Type[] { typeof(Camera) }); EditorGUILayout.Space(); Camera camera = null; if (Selection.activeGameObject) { camera = Selection.activeGameObject.GetComponent <Camera>(); } if (camera) { Camera[] objects = new Camera[] { camera }; EditorGUILayout.MultiSelectionObjectTitleBar(objects); EditorGUILayout.HelpBox(OcclusionCullingWindow.s_Styles.seeVisualizationInScene.text, MessageType.Info); } else { GUILayout.Label(OcclusionCullingWindow.s_Styles.emptyCameraSelection, EditorStyles.helpBox, new GUILayoutOption[0]); } }
private static void ObjectSettings() { GameObject[] objArray; bool flag = true; Type[] types = new Type[] { typeof(MeshRenderer), typeof(Terrain) }; SceneModeUtility.SearchBar(types); EditorGUILayout.Space(); MeshRenderer[] selectedObjectsOfType = SceneModeUtility.GetSelectedObjectsOfType <MeshRenderer>(out objArray, new Type[0]); if (objArray.Length > 0) { flag = false; ObjectSettings(selectedObjectsOfType, objArray); } Terrain[] components = SceneModeUtility.GetSelectedObjectsOfType <Terrain>(out objArray, new Type[0]); if (objArray.Length > 0) { flag = false; ObjectSettings(components, objArray); } if (flag) { GUILayout.Label("Select a MeshRenderer or a Terrain from the scene.", EditorStyles.helpBox, new GUILayoutOption[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]); }
private void AreaSelectionGUI() { bool flag = true; Type type = SceneModeUtility.SearchBar(new Type[] { typeof(Renderer), typeof(OcclusionArea) }); EditorGUILayout.Space(); GameObject[] array; OcclusionArea[] selectedObjectsOfType = SceneModeUtility.GetSelectedObjectsOfType <OcclusionArea>(out array, new Type[0]); if (array.Length > 0) { flag = false; EditorGUILayout.MultiSelectionObjectTitleBar(selectedObjectsOfType); SerializedObject serializedObject = new SerializedObject(selectedObjectsOfType); EditorGUILayout.PropertyField(serializedObject.FindProperty("m_IsViewVolume"), new GUILayoutOption[0]); serializedObject.ApplyModifiedProperties(); } Renderer[] selectedObjectsOfType2 = SceneModeUtility.GetSelectedObjectsOfType <Renderer>(out array, new Type[] { typeof(MeshRenderer), typeof(SkinnedMeshRenderer) }); if (array.Length > 0) { flag = false; EditorGUILayout.MultiSelectionObjectTitleBar(selectedObjectsOfType2); SerializedObject serializedObject2 = new SerializedObject(array); SceneModeUtility.StaticFlagField("Occluder Static", serializedObject2.FindProperty("m_StaticEditorFlags"), 2); SceneModeUtility.StaticFlagField("Occludee Static", serializedObject2.FindProperty("m_StaticEditorFlags"), 16); serializedObject2.ApplyModifiedProperties(); } if (flag) { GUILayout.Label(OcclusionCullingWindow.s_Styles.emptyAreaSelection, EditorStyles.helpBox, new GUILayoutOption[0]); if (type == typeof(OcclusionArea)) { EditorGUIUtility.labelWidth = 80f; EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); EditorGUILayout.PrefixLabel("Create New"); if (GUILayout.Button("Occlusion Area", EditorStyles.miniButton, new GUILayoutOption[] { GUILayout.ExpandWidth(false) })) { this.CreateNewArea(); } EditorGUILayout.EndHorizontal(); } } }
void AreaSelectionGUI() { bool emptySelection = true; GameObject[] gos; Type focusType = SceneModeUtility.SearchBar(typeof(Renderer), typeof(OcclusionArea)); EditorGUILayout.Space(); // Occlusion Areas OcclusionArea[] oas = SceneModeUtility.GetSelectedObjectsOfType <OcclusionArea>(out gos); if (gos.Length > 0) { emptySelection = false; EditorGUILayout.MultiSelectionObjectTitleBar(oas); using (var so = new SerializedObject(oas)) { EditorGUILayout.PropertyField(so.FindProperty("m_IsViewVolume")); so.ApplyModifiedProperties(); } } // Renderers Renderer[] renderers = SceneModeUtility.GetSelectedObjectsOfType <Renderer>(out gos, typeof(MeshRenderer), typeof(SkinnedMeshRenderer)); if (gos.Length > 0) { emptySelection = false; EditorGUILayout.MultiSelectionObjectTitleBar(renderers); using (var goso = new SerializedObject(gos)) { SceneModeUtility.StaticFlagField("Occluder Static", goso.FindProperty("m_StaticEditorFlags"), (int)StaticEditorFlags.OccluderStatic); SceneModeUtility.StaticFlagField("Occludee Static", goso.FindProperty("m_StaticEditorFlags"), (int)StaticEditorFlags.OccludeeStatic); goso.ApplyModifiedProperties(); } } if (emptySelection) { GUILayout.Label(s_Styles.emptyAreaSelection, EditorStyles.helpBox); if (focusType == typeof(OcclusionArea)) { EditorGUIUtility.labelWidth = 80; EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel("Create New"); if (GUILayout.Button("Occlusion Area", EditorStyles.miniButton, GUILayout.ExpandWidth(false))) { CreateNewArea(); } EditorGUILayout.EndHorizontal(); } } }
public void ObjectSettings() { if (LightingWindowObjectTab.s_Styles == null) { LightingWindowObjectTab.s_Styles = new LightingWindowObjectTab.Styles(); } SceneModeUtility.SearchBar(typeof(Light), typeof(Renderer), typeof(Terrain)); EditorGUILayout.Space(); if (false | this.EditRenderers() | this.EditLightmapParameters() | this.EditLights() | this.EditTerrains()) { return; } GUILayout.Label(LightingWindowObjectTab.s_Styles.EmptySelection, EditorStyles.helpBox, new GUILayoutOption[0]); }
private void AreaSelectionGUI() { GameObject[] objArray; bool flag = true; Type[] types = new Type[] { typeof(Renderer), typeof(OcclusionArea) }; Type type = SceneModeUtility.SearchBar(types); EditorGUILayout.Space(); OcclusionArea[] selectedObjectsOfType = SceneModeUtility.GetSelectedObjectsOfType <OcclusionArea>(out objArray, new Type[0]); if (objArray.Length > 0) { flag = false; EditorGUILayout.MultiSelectionObjectTitleBar(selectedObjectsOfType); SerializedObject obj2 = new SerializedObject(selectedObjectsOfType); EditorGUILayout.PropertyField(obj2.FindProperty("m_IsViewVolume"), new GUILayoutOption[0]); obj2.ApplyModifiedProperties(); } Type[] typeArray2 = new Type[] { typeof(MeshRenderer), typeof(SkinnedMeshRenderer) }; Renderer[] objects = SceneModeUtility.GetSelectedObjectsOfType <Renderer>(out objArray, typeArray2); if (objArray.Length > 0) { flag = false; EditorGUILayout.MultiSelectionObjectTitleBar(objects); SerializedObject obj3 = new SerializedObject(objArray); SceneModeUtility.StaticFlagField("Occluder Static", obj3.FindProperty("m_StaticEditorFlags"), 2); SceneModeUtility.StaticFlagField("Occludee Static", obj3.FindProperty("m_StaticEditorFlags"), 0x10); obj3.ApplyModifiedProperties(); } if (flag) { GUILayout.Label(s_Styles.emptyAreaSelection, EditorStyles.helpBox, new GUILayoutOption[0]); if (type == typeof(OcclusionArea)) { EditorGUIUtility.labelWidth = 80f; EditorGUILayout.Space(); EditorGUILayout.BeginHorizontal(new GUILayoutOption[0]); EditorGUILayout.PrefixLabel("Create New"); GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.ExpandWidth(false) }; if (GUILayout.Button("Occlusion Area", EditorStyles.miniButton, options)) { this.CreateNewArea(); } EditorGUILayout.EndHorizontal(); } } }
public void ObjectSettings() { if (s_Styles == null) { s_Styles = new Styles(); } System.Type[] types = new System.Type[] { typeof(Light), typeof(Renderer), typeof(Terrain) }; SceneModeUtility.SearchBar(types); EditorGUILayout.Space(); bool flag = false; flag |= this.EditRenderers(); flag |= this.EditLightmapParameters(); flag |= this.EditLights(); if (!(flag | this.EditTerrains())) { GUILayout.Label(s_Styles.EmptySelection, EditorStyles.helpBox, new GUILayoutOption[0]); } }
private void CameraSelectionGUI() { SceneModeUtility.SearchBar(typeof(Camera)); EditorGUILayout.Space(); Camera camera = (Camera)null; if ((bool)((UnityEngine.Object)Selection.activeGameObject)) { camera = Selection.activeGameObject.GetComponent <Camera>(); } if ((bool)((UnityEngine.Object)camera)) { EditorGUILayout.MultiSelectionObjectTitleBar((UnityEngine.Object[]) new Camera[1] { camera }); EditorGUILayout.HelpBox(OcclusionCullingWindow.s_Styles.seeVisualizationInScene.text, MessageType.Info); } else { GUILayout.Label(OcclusionCullingWindow.s_Styles.emptyCameraSelection, EditorStyles.helpBox, new GUILayoutOption[0]); } }
private void CameraSelectionGUI() { Type[] types = new Type[] { typeof(Camera) }; SceneModeUtility.SearchBar(types); EditorGUILayout.Space(); Camera component = null; if (Selection.activeGameObject != null) { component = Selection.activeGameObject.GetComponent <Camera>(); } if (component != null) { Camera[] objects = new Camera[] { component }; EditorGUILayout.MultiSelectionObjectTitleBar(objects); EditorGUILayout.HelpBox(s_Styles.seeVisualizationInScene.text, MessageType.Info); } else { GUILayout.Label(s_Styles.emptyCameraSelection, EditorStyles.helpBox, new GUILayoutOption[0]); } }
void CameraSelectionGUI() { SceneModeUtility.SearchBar(typeof(Camera)); EditorGUILayout.Space(); Camera cam = null; if (Selection.activeGameObject) { cam = Selection.activeGameObject.GetComponent <Camera>(); } // Camera if (cam) { Camera[] cameras = new Camera[] { cam }; EditorGUILayout.MultiSelectionObjectTitleBar(cameras); EditorGUILayout.HelpBox(s_Styles.seeVisualizationInScene.text, MessageType.Info); } else { GUILayout.Label(s_Styles.emptyCameraSelection, EditorStyles.helpBox); } }