ARSDKAbout.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. using UnityEditor;
  2. using UnityEngine;
  3. using UnityEngine.Rendering;
  4. [InitializeOnLoad]
  5. public class ARSDKAbout : EditorWindow
  6. {
  7. public ARSDKConfig config;
  8. Texture2D logo;
  9. [MenuItem("ARSDK/About", false, 99)]
  10. public static void ShowWindow()
  11. {
  12. EditorWindow window = EditorWindow.GetWindow(typeof(ARSDKAbout), false, "About");
  13. window.minSize = new Vector2(300, 350);
  14. }
  15. void OnGUI()
  16. {
  17. if (logo == null)
  18. {
  19. logo = Resources.Load<Texture2D>("ezxr_logo");
  20. }
  21. GUIStyle label_Red = new GUIStyle(EditorStyles.label);
  22. label_Red.normal.textColor = Color.red;
  23. GUIStyle label_Green = new GUIStyle(EditorStyles.label);
  24. label_Green.normal.textColor = Color.green;
  25. GUILayout.Button(logo, GUILayout.Height(150));
  26. GUILayout.Label("Version:" + config.version);
  27. GUILayout.FlexibleSpace();
  28. GUILayout.Label("License Type:");
  29. GUILayout.BeginHorizontal();
  30. {
  31. GUILayout.Space(20);
  32. GUILayout.BeginVertical();
  33. {
  34. GUILayout.BeginHorizontal();
  35. GUILayout.Label("SpatialTracking:");
  36. if (config.spatialTracking)
  37. {
  38. GUILayout.Label("Authorized", label_Green);
  39. }
  40. else
  41. {
  42. GUILayout.Label("Unauthorized", label_Red);
  43. }
  44. GUILayout.FlexibleSpace();
  45. GUILayout.EndHorizontal();
  46. /* 移除SpatialPositioning 模块
  47. GUILayout.BeginHorizontal();
  48. GUILayout.Label("SpatialPositioning:");
  49. if (config.spatialPositioning)
  50. {
  51. GUILayout.Label("Authorized", label_Green);
  52. }
  53. else
  54. {
  55. GUILayout.Label("Unauthorized", label_Red);
  56. }
  57. GUILayout.FlexibleSpace();
  58. GUILayout.EndHorizontal();
  59. */
  60. GUILayout.BeginHorizontal();
  61. GUILayout.Label("SpatialComputing:");
  62. if (config.spatialComputing)
  63. {
  64. GUILayout.Label("Authorized", label_Green);
  65. }
  66. else
  67. {
  68. GUILayout.Label("Unauthorized", label_Red);
  69. }
  70. GUILayout.FlexibleSpace();
  71. GUILayout.EndHorizontal();
  72. GUILayout.BeginHorizontal();
  73. GUILayout.Label("SpatialMesh:");
  74. if (config.spatialComputing)
  75. {
  76. GUILayout.Label("Authorized", label_Green);
  77. }
  78. else
  79. {
  80. GUILayout.Label("Unauthorized", label_Red);
  81. }
  82. GUILayout.FlexibleSpace();
  83. GUILayout.EndHorizontal();
  84. GUILayout.BeginHorizontal();
  85. GUILayout.Label("InputSystem:");
  86. if (config.inputSystem)
  87. {
  88. GUILayout.Label("Authorized", label_Green);
  89. }
  90. else
  91. {
  92. GUILayout.Label("Unauthorized", label_Red);
  93. }
  94. GUILayout.FlexibleSpace();
  95. GUILayout.EndHorizontal();
  96. GUILayout.BeginHorizontal();
  97. GUILayout.Label("ImageTracking:");
  98. if (config.imageTracking)
  99. {
  100. GUILayout.Label("Authorized", label_Green);
  101. }
  102. else
  103. {
  104. GUILayout.Label("Unauthorized", label_Red);
  105. }
  106. GUILayout.FlexibleSpace();
  107. GUILayout.EndHorizontal();
  108. GUILayout.BeginHorizontal();
  109. GUILayout.Label("ObjectDetection:");
  110. if (config.objectDetection)
  111. {
  112. GUILayout.Label("Authorized", label_Green);
  113. }
  114. else
  115. {
  116. GUILayout.Label("Unauthorized", label_Red);
  117. }
  118. GUILayout.FlexibleSpace();
  119. GUILayout.EndHorizontal();
  120. GUILayout.BeginHorizontal();
  121. GUILayout.Label("QRScanner:");
  122. if (config.qrScanner)
  123. {
  124. GUILayout.Label("Authorized", label_Green);
  125. }
  126. else
  127. {
  128. GUILayout.Label("Unauthorized", label_Red);
  129. }
  130. GUILayout.FlexibleSpace();
  131. GUILayout.EndHorizontal();
  132. GUILayout.FlexibleSpace();
  133. }
  134. GUILayout.EndVertical();
  135. }
  136. GUILayout.EndHorizontal();
  137. }
  138. }