protected virtual void DoGUI() { GUILayout.Space(50f); GUILayout.Label($"file path: {KVS.PrefsKVSPathSelector.path}"); if (GUILayout.Button("Save")) { Prefs.Save(); } if (GUILayout.Button("DeleteAll")) { Prefs.DeleteAll(); } }
void OnGUIInternal() { isUseLeap.OnGUI(); GUILayout.Space(10); GUILayout.Label("Water Sim"); viscosity.OnGUISlider(1, 80); handRadius.OnGUISlider(1, 3); range.OnGUISlider(new Vector2(5, 5), new Vector2(20, 20)); gravity.OnGUISlider(new Vector2(-10, -10), new Vector2(10, 10)); if (GUILayout.Button("Save")) { Prefs.Save(); } if (GUILayout.Button("DeleteAll")) { Prefs.DeleteAll(); } }
protected override void OnGUIInternal() { using (new GUILayout.HorizontalScope()) { if (GUILayout.Button("Save")) { Prefs.Save(); } if (GUILayout.Button("Load")) { Prefs.Load(); } if (GUILayout.Button("DeleteAll")) { if (EditorUtility.DisplayDialog("DeleteAll", "Are you sure to delete all current prefs parameters?", "DeleteAll", "Don't Delete")) { Prefs.DeleteAll(); } } } var prefsAll = ObjectPrefsUtility.objPrefsList.SelectMany(gp => gp.prefsList).ToList(); var currentToDefaultEnable = !Application.isPlaying && prefsAll.Any(prefs => !prefs.IsDefault); using (new RGUI.EnabledScope(currentToDefaultEnable)) { if (GUILayout.Button("Open Current To Default Window")) { if (setCurrentToDefaultWindow == null) { setCurrentToDefaultWindow = CreateInstance <SetCurrentToDefaultWindow>(); } setCurrentToDefaultWindow.parentWindow = this; setCurrentToDefaultWindow.ShowUtility(); } } GUILayout.Space(8f); using (new GUILayout.HorizontalScope()) { GUILayout.Label("Order"); order = (Order)GUILayout.Toolbar((int)order, System.Enum.GetNames(typeof(Order))); EditorGUILayout.Space(); } GUILayout.Space(8f); extension?.GUIHeadLine(); switch (order) { case Order.AtoZ: scrollViewAtoZ.DoGUI(prefsAll.OrderBy(p => p.key), (prefs) => { using (new GUILayout.HorizontalScope()) { extension?.GUIPrefsLeft(prefs); prefs.DoGUI(); } }); break; case Order.GameObject: scrollViewGameObject.DoGUI(ObjectPrefsUtility.objPrefsList, (gp) => { LabelWithEditPrefix(gp); using (new RGUI.IndentScope()) { gp.prefsList.ToList().ForEach(prefs => { using (new GUILayout.HorizontalScope()) { extension?.GUIPrefsLeft(prefs); prefs.DoGUI(); } }); } }); break; } }