override public void OnInspectorGUI(InitialModuleUI initial) { EditorGUI.BeginChangeCheck(); CollisionTypes type = (CollisionTypes)GUIPopup(s_Texts.collisionType, m_Type, s_Texts.collisionTypes); if (EditorGUI.EndChangeCheck()) { ToolManager.RefreshAvailableTools(); } if (type == CollisionTypes.Plane) { DoListOfPlanesGUI(); } else { GUIPopup(s_Texts.collisionMode, m_CollisionMode, s_Texts.collisionModes); } GUIMinMaxCurve(s_Texts.dampen, m_Dampen); GUIMinMaxCurve(s_Texts.bounce, m_Bounce); GUIMinMaxCurve(s_Texts.lifetimeLoss, m_LifetimeLossOnCollision); GUIFloat(s_Texts.minKillSpeed, m_MinKillSpeed); GUIFloat(s_Texts.maxKillSpeed, m_MaxKillSpeed); GUIFloat(s_Texts.radiusScale, m_RadiusScale); if (type == CollisionTypes.World) { GUIPopup(s_Texts.quality, m_Quality, s_Texts.qualitySettings); EditorGUI.indentLevel++; GUILayerMask(s_Texts.collidesWith, m_CollidesWith); GUIInt(s_Texts.maxCollisionShapes, m_MaxCollisionShapes); if (m_Quality.intValue == 0) { GUIToggle(s_Texts.collidesWithDynamic, m_CollidesWithDynamic); } else { GUIFloat(s_Texts.voxelSize, m_VoxelSize); } EditorGUI.indentLevel--; GUIFloat(s_Texts.colliderForce, m_ColliderForce); EditorGUI.indentLevel++; GUIToggle(s_Texts.multiplyColliderForceByCollisionAngle, m_MultiplyColliderForceByCollisionAngle); GUIToggle(s_Texts.multiplyColliderForceByParticleSpeed, m_MultiplyColliderForceByParticleSpeed); GUIToggle(s_Texts.multiplyColliderForceByParticleSize, m_MultiplyColliderForceByParticleSize); EditorGUI.indentLevel--; } GUIToggle(s_Texts.collisionMessages, m_CollisionMessages); if (EditorGUIUtility.comparisonViewMode == EditorGUIUtility.ComparisonViewMode.None) { EditorGUILayout.BeginVertical("GroupBox"); if (type == CollisionTypes.Plane) { var editorTools = new List <EditorTool>(2); EditorToolManager.GetComponentTools(x => x.GetEditor <EditorTool>() is CollisionModuleTransformTool, editorTools, true); GUILayout.BeginHorizontal(); EditorGUILayout.PrefixLabel(s_Texts.sceneTools, ParticleSystemStyles.Get().label, ParticleSystemStyles.Get().label); EditorGUILayout.EditorToolbar(editorTools); GUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUI.BeginChangeCheck(); m_PlaneVisualizationType = (PlaneVizType)GUIPopup(s_Texts.visualization, (int)m_PlaneVisualizationType, s_Texts.planeVizTypes); if (EditorGUI.EndChangeCheck()) { EditorPrefs.SetInt("PlaneColisionVizType", (int)m_PlaneVisualizationType); } EditorGUI.BeginChangeCheck(); m_ScaleGrid = GUIFloat(s_Texts.scalePlane, m_ScaleGrid, "f2"); if (EditorGUI.EndChangeCheck()) { m_ScaleGrid = Mathf.Max(0f, m_ScaleGrid); EditorPrefs.SetFloat("ScalePlaneColision", m_ScaleGrid); } } else { GUILayout.Label(s_Texts.sceneTools, ParticleSystemStyles.Get().label); } EditorGUI.BeginChangeCheck(); s_VisualizeBounds = GUIToggle(s_Texts.visualizeBounds, s_VisualizeBounds); if (EditorGUI.EndChangeCheck()) { EditorPrefs.SetBool("VisualizeBounds", s_VisualizeBounds); } EditorGUILayout.EndVertical(); } }
// Add items to the context menu for the AudioMixerWindow (the tree horizontal lines, upper right corner) public virtual void AddItemsToMenu(GenericMenu menu) { menu.AddItem(EditorGUIUtility.TrTextContent("Sort groups alphabetically"), m_SortGroupsAlphabetically, delegate { m_SortGroupsAlphabetically = !m_SortGroupsAlphabetically; }); menu.AddItem(EditorGUIUtility.TrTextContent("Show referenced groups"), m_ShowReferencedBuses, delegate { m_ShowReferencedBuses = !m_ShowReferencedBuses; }); menu.AddItem(EditorGUIUtility.TrTextContent("Show group connections"), m_ShowBusConnections, delegate { m_ShowBusConnections = !m_ShowBusConnections; }); if (m_ShowBusConnections) { menu.AddItem(EditorGUIUtility.TrTextContent("Only highlight selected group connections"), m_ShowBusConnectionsOfSelection, delegate { m_ShowBusConnectionsOfSelection = !m_ShowBusConnectionsOfSelection; }); } menu.AddSeparator(""); menu.AddItem(EditorGUIUtility.TrTextContent("Vertical layout"), layoutMode == LayoutMode.Vertical, delegate { layoutMode = LayoutMode.Vertical; }); menu.AddItem(EditorGUIUtility.TrTextContent("Horizontal layout"), layoutMode == LayoutMode.Horizontal, delegate { layoutMode = LayoutMode.Horizontal; }); menu.AddSeparator(""); menu.AddItem(EditorGUIUtility.TrTextContent("Use RMS metering for display"), EditorPrefs.GetBool(kAudioMixerUseRMSMetering, true), delegate { EditorPrefs.SetBool(kAudioMixerUseRMSMetering, true); }); menu.AddItem(EditorGUIUtility.TrTextContent("Use peak metering for display"), !EditorPrefs.GetBool(kAudioMixerUseRMSMetering, true), delegate { EditorPrefs.SetBool(kAudioMixerUseRMSMetering, false); }); if (Unsupported.IsDeveloperMode()) { menu.AddSeparator(""); menu.AddItem(EditorGUIUtility.TrTextContent("DEVELOPER/Groups Rendered Above"), m_GroupsRenderedAboveSections, delegate { m_GroupsRenderedAboveSections = !m_GroupsRenderedAboveSections; }); menu.AddItem(EditorGUIUtility.TrTextContent("DEVELOPER/Build 10 groups"), false, delegate { m_Controller.BuildTestSetup(0, 7, 10); }); menu.AddItem(EditorGUIUtility.TrTextContent("DEVELOPER/Build 20 groups"), false, delegate { m_Controller.BuildTestSetup(0, 7, 20); }); menu.AddItem(EditorGUIUtility.TrTextContent("DEVELOPER/Build 40 groups"), false, delegate { m_Controller.BuildTestSetup(0, 7, 40); }); menu.AddItem(EditorGUIUtility.TrTextContent("DEVELOPER/Build 80 groups"), false, delegate { m_Controller.BuildTestSetup(0, 7, 80); }); menu.AddItem(EditorGUIUtility.TrTextContent("DEVELOPER/Build 160 groups"), false, delegate { m_Controller.BuildTestSetup(0, 7, 160); }); menu.AddItem(EditorGUIUtility.TrTextContent("DEVELOPER/Build chain of 10 groups"), false, delegate { m_Controller.BuildTestSetup(1, 1, 10); }); menu.AddItem(EditorGUIUtility.TrTextContent("DEVELOPER/Build chain of 20 groups "), false, delegate { m_Controller.BuildTestSetup(1, 1, 20); }); menu.AddItem(EditorGUIUtility.TrTextContent("DEVELOPER/Build chain of 40 groups"), false, delegate { m_Controller.BuildTestSetup(1, 1, 40); }); menu.AddItem(EditorGUIUtility.TrTextContent("DEVELOPER/Build chain of 80 groups"), false, delegate { m_Controller.BuildTestSetup(1, 1, 80); }); menu.AddItem(EditorGUIUtility.TrTextContent("DEVELOPER/Show overlays"), m_ShowDeveloperOverlays, delegate { m_ShowDeveloperOverlays = !m_ShowDeveloperOverlays; }); } }
public override void OnInspectorGUI(ParticleSystem s) { if (CollisionModuleUI.s_Texts == null) { CollisionModuleUI.s_Texts = new CollisionModuleUI.Texts(); } string[] options = new string[] { "Planes", "World" }; EditorGUI.BeginChangeCheck(); CollisionModuleUI.CollisionTypes collisionTypes = (CollisionModuleUI.CollisionTypes)ModuleUI.GUIPopup("", this.m_Type, options, new GUILayoutOption[0]); bool flag = EditorGUI.EndChangeCheck(); CollisionModuleUI.CollisionModes collisionModes = CollisionModuleUI.CollisionModes.Mode3D; if (collisionTypes == CollisionModuleUI.CollisionTypes.Plane) { this.DoListOfPlanesGUI(); EditorGUI.BeginChangeCheck(); this.m_PlaneVisualizationType = (CollisionModuleUI.PlaneVizType)ModuleUI.GUIPopup(CollisionModuleUI.s_Texts.visualization, (int)this.m_PlaneVisualizationType, this.m_PlaneVizTypeNames, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck() || flag) { EditorPrefs.SetInt("PlaneColisionVizType", (int)this.m_PlaneVisualizationType); if (this.m_PlaneVisualizationType == CollisionModuleUI.PlaneVizType.Solid) { this.SyncVisualization(); } else { ParticleEffectUtils.ClearPlanes(); } } EditorGUI.BeginChangeCheck(); this.m_ScaleGrid = ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.scalePlane, this.m_ScaleGrid, "f2", new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { this.m_ScaleGrid = Mathf.Max(0f, this.m_ScaleGrid); EditorPrefs.SetFloat("ScalePlaneColision", this.m_ScaleGrid); this.SyncVisualization(); } } else { ParticleEffectUtils.ClearPlanes(); collisionModes = (CollisionModuleUI.CollisionModes)ModuleUI.GUIPopup(CollisionModuleUI.s_Texts.collisionMode, this.m_CollisionMode, new string[] { "3D", "2D" }, new GUILayoutOption[0]); } EditorGUI.BeginChangeCheck(); CollisionModuleUI.s_VisualizeBounds = ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.visualizeBounds, CollisionModuleUI.s_VisualizeBounds, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { EditorPrefs.SetBool("VisualizeBounds", CollisionModuleUI.s_VisualizeBounds); } ModuleUI.GUIMinMaxCurve(CollisionModuleUI.s_Texts.dampen, this.m_Dampen, new GUILayoutOption[0]); ModuleUI.GUIMinMaxCurve(CollisionModuleUI.s_Texts.bounce, this.m_Bounce, new GUILayoutOption[0]); ModuleUI.GUIMinMaxCurve(CollisionModuleUI.s_Texts.lifetimeLoss, this.m_LifetimeLossOnCollision, new GUILayoutOption[0]); ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.minKillSpeed, this.m_MinKillSpeed, new GUILayoutOption[0]); ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.maxKillSpeed, this.m_MaxKillSpeed, new GUILayoutOption[0]); ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.radiusScale, this.m_RadiusScale, new GUILayoutOption[0]); if (collisionTypes == CollisionModuleUI.CollisionTypes.World) { ModuleUI.GUILayerMask(CollisionModuleUI.s_Texts.collidesWith, this.m_CollidesWith, new GUILayoutOption[0]); if (collisionModes == CollisionModuleUI.CollisionModes.Mode3D) { ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.interiorCollisions, this.m_InteriorCollisions, new GUILayoutOption[0]); } ModuleUI.GUIInt(CollisionModuleUI.s_Texts.maxCollisionShapes, this.m_MaxCollisionShapes, new GUILayoutOption[0]); ModuleUI.GUIPopup(CollisionModuleUI.s_Texts.quality, this.m_Quality, CollisionModuleUI.s_Texts.qualitySettings, new GUILayoutOption[0]); if (this.m_Quality.intValue == 0) { ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.collidesWithDynamic, this.m_CollidesWithDynamic, new GUILayoutOption[0]); } else { ModuleUI.GUIFloat(CollisionModuleUI.s_Texts.voxelSize, this.m_VoxelSize, new GUILayoutOption[0]); } } ModuleUI.GUIToggle(CollisionModuleUI.s_Texts.collisionMessages, this.m_CollisionMessages, new GUILayoutOption[0]); }
private static void ShowCPUUsage(MenuCommand command) { bool @bool = EditorPrefs.GetBool(AudioMixerGroupEditor.kPrefKeyForShowCpuUsage, false); EditorPrefs.SetBool(AudioMixerGroupEditor.kPrefKeyForShowCpuUsage, !@bool); }
override public void OnInspectorGUI(InitialModuleUI initial) { EditorGUI.BeginChangeCheck(); CollisionTypes type = (CollisionTypes)GUIPopup(s_Texts.collisionType, m_Type, s_Texts.collisionTypes); if (EditorGUI.EndChangeCheck()) { SyncVisualization(); } if (type == CollisionTypes.Plane) { DoListOfPlanesGUI(); EditorGUI.BeginChangeCheck(); m_PlaneVisualizationType = (PlaneVizType)GUIPopup(s_Texts.visualization, (int)m_PlaneVisualizationType, s_Texts.planeVizTypes); if (EditorGUI.EndChangeCheck()) { EditorPrefs.SetInt("PlaneColisionVizType", (int)m_PlaneVisualizationType); } EditorGUI.BeginChangeCheck(); m_ScaleGrid = GUIFloat(s_Texts.scalePlane, m_ScaleGrid, "f2"); if (EditorGUI.EndChangeCheck()) { m_ScaleGrid = Mathf.Max(0f, m_ScaleGrid); EditorPrefs.SetFloat("ScalePlaneColision", m_ScaleGrid); } GUIButtonGroup(s_SceneViewEditModes, s_Texts.toolContents, m_ParticleSystemUI.GetBounds, m_ParticleSystemUI.m_ParticleEffectUI.m_Owner.customEditor); } else { GUIPopup(s_Texts.collisionMode, m_CollisionMode, s_Texts.collisionModes); } GUIMinMaxCurve(s_Texts.dampen, m_Dampen); GUIMinMaxCurve(s_Texts.bounce, m_Bounce); GUIMinMaxCurve(s_Texts.lifetimeLoss, m_LifetimeLossOnCollision); GUIFloat(s_Texts.minKillSpeed, m_MinKillSpeed); GUIFloat(s_Texts.maxKillSpeed, m_MaxKillSpeed); GUIFloat(s_Texts.radiusScale, m_RadiusScale); if (type == CollisionTypes.World) { GUIPopup(s_Texts.quality, m_Quality, s_Texts.qualitySettings); EditorGUI.indentLevel++; GUILayerMask(s_Texts.collidesWith, m_CollidesWith); GUIInt(s_Texts.maxCollisionShapes, m_MaxCollisionShapes); if (m_Quality.intValue == 0) { GUIToggle(s_Texts.collidesWithDynamic, m_CollidesWithDynamic); } else { GUIFloat(s_Texts.voxelSize, m_VoxelSize); } EditorGUI.indentLevel--; GUIFloat(s_Texts.colliderForce, m_ColliderForce); EditorGUI.indentLevel++; GUIToggle(s_Texts.multiplyColliderForceByCollisionAngle, m_MultiplyColliderForceByCollisionAngle); GUIToggle(s_Texts.multiplyColliderForceByParticleSpeed, m_MultiplyColliderForceByParticleSpeed); GUIToggle(s_Texts.multiplyColliderForceByParticleSize, m_MultiplyColliderForceByParticleSize); EditorGUI.indentLevel--; } GUIToggle(s_Texts.collisionMessages, m_CollisionMessages); EditorGUI.BeginChangeCheck(); s_VisualizeBounds = GUIToggle(s_Texts.visualizeBounds, s_VisualizeBounds); if (EditorGUI.EndChangeCheck()) { EditorPrefs.SetBool("VisualizeBounds", s_VisualizeBounds); } }
public void OnDisable() { AudioUtil.StopAllClips(); EditorPrefs.SetBool("AutoPlayAudio", AudioClipInspector.m_bAutoPlay); }