AboutWindow.cs 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using UnityEditor;
  7. using UnityEngine;
  8. namespace TheraBytes.BetterUi
  9. {
  10. public class AboutWindow : EditorWindow
  11. {
  12. const string VERSION = "2.5";
  13. [MenuItem("Tools/Better UI/Help/Documentation", false, 300)]
  14. public static void OpenDocumentation()
  15. {
  16. Application.OpenURL("https://documentation.therabytes.de/better-ui");
  17. }
  18. [MenuItem("Tools/Better UI/Help/Get Support (Forum)", false, 330)]
  19. public static void OpenForum()
  20. {
  21. Application.OpenURL("https://forum.unity3d.com/threads/better-ui.453808/");
  22. }
  23. [MenuItem("Tools/Better UI/Help/Get Support (Email)", false, 331)]
  24. public static void WriteMail()
  25. {
  26. Application.OpenURL("mailto:info@therabytes.de?subject=Better%20UI");
  27. }
  28. [MenuItem("Tools/Better UI/Help/Leave a Review", false, 360)]
  29. public static void OpenAssetStore()
  30. {
  31. Application.OpenURL("https://assetstore.unity.com/packages/tools/gui/better-ui-79031#reviews");
  32. }
  33. [MenuItem("Tools/Better UI/Help/About", false, 390)]
  34. public static void ShowWindow()
  35. {
  36. var win = EditorWindow.GetWindow(typeof(AboutWindow), true, "About");
  37. win.minSize = new Vector2(524, 400);
  38. win.maxSize = win.minSize;
  39. }
  40. GUIContent image;
  41. void OnEnable()
  42. {
  43. image = new GUIContent(Resources.Load<Texture2D>("wizard_banner"));
  44. }
  45. void OnGUI()
  46. {
  47. EditorGUILayout.Space();
  48. EditorGUILayout.LabelField(image, EditorStyles.wordWrappedLabel);
  49. EditorGUILayout.Space();
  50. EditorGUILayout.LabelField("Better UI", EditorStyles.boldLabel);
  51. EditorGUILayout.LabelField($"Version {VERSION}");
  52. EditorGUILayout.Space();
  53. EditorGUILayout.LabelField("© 2023 Thera Bytes GmbH - All Rights Reserved", EditorStyles.miniBoldLabel);
  54. EditorGUILayout.LabelField("Created by Saloomon Zwecker", EditorStyles.miniLabel);
  55. EditorGUILayout.Space();
  56. EditorGUILayout.LabelField("Standard Unity Asset Store End User License Agreement", EditorStyles.miniLabel);
  57. }
  58. }
  59. }