private static void OnGUISettings() { if (HQ.Settings == null) { return; } EditorGUILayout.Space(); EditorGUI.BeginChangeCheck(); EditorGUILayout.LabelField("Add an offset on NG Hub's window Y-axis.", GeneralStyles.WrapLabel); float offset = EditorGUILayout.FloatField("Y Offset Window", HQ.Settings.Get <HubSettings>().NGHubYOffset); EditorGUILayout.HelpBox("This is a workaround. Most of the time NG Hub is correctly placed, but in some cases, it is not.", MessageType.Info); EditorGUILayout.HelpBox("If you have the offset bug and you are willing to fix it, contact me through " + Constants.SupportEmail + ".", MessageType.Info); if (GUILayout.Button("Contact the author") == true) { ContactFormWizard.Open(ContactFormWizard.Subject.Support); } if (EditorGUI.EndChangeCheck() == true) { HQ.Settings.Get <HubSettings>().NGHubYOffset = offset; HQ.InvalidateSettings(); } }
private static void OnGUISettings() { if (Utility.IsCustomEditorCompatible == false) { EditorGUILayout.HelpBox("NG Tools has detected a change in Unity code. Please contact the author.", MessageType.Error); if (GUILayout.Button("Contact the author") == true) { ContactFormWizard.Open(ContactFormWizard.Subject.BugReport, "MonoScriptEditor is incompatible with " + Utility.UnityVersion + "."); } return; } InspectorGadgetSettings settings = HQ.Settings.Get <InspectorGadgetSettings>(); EditorGUI.BeginChangeCheck(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Script visualizer lets you select the text when you inspect a script.", GeneralStyles.WrapLabel); bool active = NGEditorGUILayout.Switch("Script Visualizer", settings.activeScriptVisualizer); if (EditorGUI.EndChangeCheck() == true) { bool mustUpdate = active == true?Utility.AddCustomEditor(typeof(MonoScript), typeof(MonoScriptEditor)) : Utility.RemoveCustomEditor(typeof(MonoScriptEditor)); if (mustUpdate == true) { MonoScriptEditor.UpdateInspector(); } settings.activeScriptVisualizer = active; HQ.InvalidateSettings(); } }
private static void OnGUISettings() { if (HQ.Settings == null) { return; } if (DragObjectDrawer.ScriptAttributeUtility == null) { EditorGUILayout.HelpBox("NG Tools has detected a change in Unity code. Please contact the author.", MessageType.Error); if (GUILayout.Button("Contact the author") == true) { ContactFormWizard.Open(ContactFormWizard.Subject.BugReport, "DragObjectDrawer is incompatible with " + Utility.UnityVersion + "."); } return; } DraggableObjectSettings settings = HQ.Settings.Get <DraggableObjectSettings>(); EditorGUI.BeginChangeCheck(); EditorGUILayout.Space(); EditorGUILayout.LabelField("Allows to drag & drop between Object fields in Inspector.", GeneralStyles.WrapLabel); bool active = EditorGUILayout.Toggle("Drag & Drop with Object", settings.active); if (EditorGUI.EndChangeCheck() == true) { HQ.InvalidateSettings(); if (active == true) { DragObjectDrawer.AddType(); } else { DragObjectDrawer.RemoveType(); } settings.active = active; } }