// Inspector GUI shown in the Editor window. Base class shows BrushSettings by default internal override void DrawGUI(BrushSettings brushSettings) { base.DrawGUI(brushSettings); /// Verify dependencies VerifyLoadedAssetsIntegrity(); EditorGUI.BeginChangeCheck(); /// Interface s_UsePivotForPlacement.value = PolyGUILayout.Toggle(m_GCUsePrefabPivot, s_UsePivotForPlacement); s_ParentObjectWithSurface.value = PolyGUILayout.Toggle(m_GCHitSurfaceIsParent, s_ParentObjectWithSurface); s_AvoidOverlappingGameObjects.value = PolyGUILayout.Toggle(m_GcAvoidOverlappingGameObjects, s_AvoidOverlappingGameObjects); EditorGUI.BeginChangeCheck(); m_CurrentPaletteIndex = EditorGUILayout.Popup(m_CurrentPaletteIndex, m_AvailablePalettesAsStrings); if (EditorGUI.EndChangeCheck()) { if (m_CurrentPaletteIndex >= m_AvailablePalettes.Length) { SetPrefabPalette(PrefabPaletteEditor.AddNew()); } else { SetPrefabPalette(m_AvailablePalettes[m_CurrentPaletteIndex]); } } using (new GUILayout.HorizontalScope()) { EditorGUILayout.LabelField("Preview Size"); s_PreviewThumbSize.value = (int)EditorGUILayout.Slider((float)s_PreviewThumbSize, 60f, 128f); } if (EditorGUI.EndChangeCheck()) { if (m_CurrentPaletteIndex >= m_AvailablePalettes.Length) { SetPrefabPalette(PrefabPaletteEditor.AddNew()); } else { SetPrefabPalette(m_AvailablePalettes[m_CurrentPaletteIndex]); } PolybrushSettings.Save(); } using (new GUILayout.VerticalScope()) { if (prefabLoadoutEditor != null) { prefabLoadoutEditor.OnInspectorGUI_Internal(s_PreviewThumbSize); } } }
/// <summary> /// Store the previous GIWorkflowMode and set the current value to OnDemand (or leave it Legacy). /// </summary> internal static void PushGIWorkflowMode() { s_GIWorkflowMode.value = (int)Lightmapping.giWorkflowMode; PolybrushSettings.Save(); if (Lightmapping.giWorkflowMode != Lightmapping.GIWorkflowMode.Legacy) { Lightmapping.giWorkflowMode = Lightmapping.GIWorkflowMode.OnDemand; } }
void SetIsUtilityWindow(bool isUtilityWindow) { PolybrushSettings.Set <bool>(utilityWindowKey, isUtilityWindow, SettingsScope.Project); PolybrushSettings.Save(); var title = titleContent; Close(); var res = GetWindow(GetType(), isUtilityWindow); res.titleContent = title; }
/// <summary> /// Store the previous GIWorkflowMode and set the current value to OnDemand (or leave it Legacy). /// </summary> internal static void PushGIWorkflowMode() { #pragma warning disable 618 s_GIWorkflowMode.value = (int)Lightmapping.giWorkflowMode; PolybrushSettings.Save(); if (Lightmapping.giWorkflowMode != Lightmapping.GIWorkflowMode.Legacy) { Lightmapping.giWorkflowMode = Lightmapping.GIWorkflowMode.OnDemand; } #pragma warning restore 618 }
internal override void DrawGUI(BrushSettings settings) { base.DrawGUI(settings); EditorGUI.BeginChangeCheck(); s_IgnoreOpenEdges.value = PolyGUILayout.Toggle(BrushModeSculpt.Styles.gcIgnoreOpenEdges, s_IgnoreOpenEdges); if (s_SmoothDirection == PolyDirection.BrushNormal) { s_UseFirstNormalVector.value = PolyGUILayout.Toggle(BrushModeSculpt.Styles.gcBrushNormalIsSticky, s_UseFirstNormalVector); } s_SmoothDirection.value = (PolyDirection)PolyGUILayout.PopupFieldWithTitle(BrushModeSculpt.Styles.gcDirection, (int)s_SmoothDirection.value, BrushModeSculpt.Styles.s_BrushDirectionList); if (EditorGUI.EndChangeCheck()) { PolybrushSettings.Save(); } }
internal void OnGUI() { using (new GUILayout.VerticalScope("box")) { if (PolyGUILayout.HeaderWithDocsLink(Styles.headerLabel)) { Application.OpenURL(PrefUtility.documentationBrushMirroringLink); } using (new GUILayout.HorizontalScope()) { EditorGUI.BeginChangeCheck(); s_MirrorAxes.value = (BrushMirror)PolyGUILayout.BitMaskField((uint)s_MirrorAxes.value, Styles.axesNameArray, Styles.axesFieldTooltip); s_MirrorSpace.value = (MirrorCoordinateSpace)GUILayout.Toolbar((int)s_MirrorSpace.value, Styles.mirrorSpaces); if (EditorGUI.EndChangeCheck()) { PolybrushSettings.Save(); RefreshSettings(); } } } }
void SaveUserCurrentLoadouts() { s_UserLoadout.value = new PrefabLoadout(m_CurrentLoadouts); PolybrushSettings.Save(); }