public static bool ToggleBool(Preference preference) { bool state = PreferencesEditor.GetBool(preference); PreferencesEditor.SetBool(preference, !state); return(!state); }
static void ShowEditor() { self = GetWindow <NodeEditorWindow>(); self.minSize = new Vector2(800, 600); Texture iconTexture = (Texture2D)AssetDatabase.LoadAssetAtPath <Texture2D>(EditorGUIUtility.isProSkin? "Textures/Icon_Dark.png" : "Textures/Icon_Light.png"); self.titleContent = new GUIContent("Node Editor", iconTexture); if (PreferencesEditor.GetBool(Preference.ShowWelcomeWindow, true)) { WelcomeWindow.ShowWindow(); } }
private void OnGUI() { GUI.DrawTexture(this.contactIconRect, this.contactIcon); GUI.Label(this.contactHeaderRect, "Contact", HeaderStyle); GUI.Label(this.contactTextRect, "Contact us in private, we are here to help.", TextStyle); GUI.DrawTexture(this.downloadIconRect, this.downloadIcon); GUI.Label(this.downloadHeaderRect, "Videos", HeaderStyle); GUI.Label(this.downloadTextRect, "Checkout our videos tutorials.", TextStyle); GUI.DrawTexture(this.documentationIconRect, this.documentationIcon); GUI.Label(this.documentationHeaderRect, "Documentation", HeaderStyle); GUI.Label(this.documenationTextRect, "Checkout our written documentation.", TextStyle); GUI.DrawTexture(this.forumIconRect, this.forumIcon); GUI.Label(this.forumHeaderRect, "Forums", HeaderStyle); GUI.Label(this.forumTextRect, "Join our forums to get support and make suggestions.", TextStyle); GUI.DrawTexture(this.addonIconRect, this.addonIcon); GUI.Label(this.addonHeaderRect, "Other Assets", HeaderStyle); GUI.Label(this.addonTextRect, "Download other assets that extend the core functionality.", TextStyle); bool state = PreferencesEditor.GetBool(Preference.ShowWelcomeWindow, true); state = GUI.Toggle(this.showOnStartRect, state, "Show at Startup"); PreferencesEditor.SetBool(Preference.ShowWelcomeWindow, state); EditorGUIUtility.AddCursorRect(this.contactIconRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.contactHeaderRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.contactTextRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.downloadIconRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.downloadHeaderRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.downloadTextRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.documentationIconRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.documentationHeaderRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.documenationTextRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.forumIconRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.forumHeaderRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.forumTextRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.addonIconRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.addonHeaderRect, MouseCursor.Link); EditorGUIUtility.AddCursorRect(this.addonTextRect, MouseCursor.Link); if (Event.current.type == EventType.mouseDown) { Vector2 mousePosition = Event.current.mousePosition; if (this.contactIconRect.Contains(mousePosition) || this.contactHeaderRect.Contains(mousePosition) || this.contactTextRect.Contains(mousePosition)) { Application.OpenURL("https://axlplay.com/contact-us/"); return; } if (this.downloadIconRect.Contains(mousePosition) || this.downloadHeaderRect.Contains(mousePosition) || this.downloadTextRect.Contains(mousePosition)) { Application.OpenURL("https://www.youtube.com/channel/UCH1BPbofMx51cXyNxvX5JFg"); return; } if (this.documentationIconRect.Contains(mousePosition) || this.documentationHeaderRect.Contains(mousePosition) || this.documenationTextRect.Contains(mousePosition)) { Application.OpenURL("https://axlplay.com/documentation/"); return; } if (this.forumIconRect.Contains(mousePosition) || this.forumHeaderRect.Contains(mousePosition) || this.forumTextRect.Contains(mousePosition)) { Application.OpenURL("https://forum.unity3d.com/threads/easy-ai.445286/"); return; } if (this.addonIconRect.Contains(mousePosition) || this.addonHeaderRect.Contains(mousePosition) || this.addonTextRect.Contains(mousePosition)) { Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/search/page=1/sortby=popularity/query=publisher:AxlPlay"); return; } } }