123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- using UnityEditor;
- using UnityEngine;
- using UnityEngine.Rendering;
- [InitializeOnLoad]
- public class ARSDKAbout : EditorWindow
- {
- public ARSDKConfig config;
- Texture2D logo;
- [MenuItem("ARSDK/About", false, 99)]
- public static void ShowWindow()
- {
- EditorWindow window = EditorWindow.GetWindow(typeof(ARSDKAbout), false, "About");
- window.minSize = new Vector2(300, 350);
- }
- void OnGUI()
- {
- if (logo == null)
- {
- logo = Resources.Load<Texture2D>("ezxr_logo");
- }
- GUIStyle label_Red = new GUIStyle(EditorStyles.label);
- label_Red.normal.textColor = Color.red;
- GUIStyle label_Green = new GUIStyle(EditorStyles.label);
- label_Green.normal.textColor = Color.green;
- GUILayout.Button(logo, GUILayout.Height(150));
- GUILayout.Label("Version:" + config.version);
- GUILayout.FlexibleSpace();
- GUILayout.Label("License Type:");
- GUILayout.BeginHorizontal();
- {
- GUILayout.Space(20);
- GUILayout.BeginVertical();
- {
- GUILayout.BeginHorizontal();
- GUILayout.Label("SpatialTracking:");
- if (config.spatialTracking)
- {
- GUILayout.Label("Authorized", label_Green);
- }
- else
- {
- GUILayout.Label("Unauthorized", label_Red);
- }
- GUILayout.FlexibleSpace();
- GUILayout.EndHorizontal();
- /* 移除SpatialPositioning 模块
- GUILayout.BeginHorizontal();
- GUILayout.Label("SpatialPositioning:");
- if (config.spatialPositioning)
- {
- GUILayout.Label("Authorized", label_Green);
- }
- else
- {
- GUILayout.Label("Unauthorized", label_Red);
- }
- GUILayout.FlexibleSpace();
- GUILayout.EndHorizontal();
- */
- GUILayout.BeginHorizontal();
- GUILayout.Label("SpatialComputing:");
- if (config.spatialComputing)
- {
- GUILayout.Label("Authorized", label_Green);
- }
- else
- {
- GUILayout.Label("Unauthorized", label_Red);
- }
- GUILayout.FlexibleSpace();
- GUILayout.EndHorizontal();
- GUILayout.BeginHorizontal();
- GUILayout.Label("SpatialMesh:");
- if (config.spatialComputing)
- {
- GUILayout.Label("Authorized", label_Green);
- }
- else
- {
- GUILayout.Label("Unauthorized", label_Red);
- }
- GUILayout.FlexibleSpace();
- GUILayout.EndHorizontal();
- GUILayout.BeginHorizontal();
- GUILayout.Label("InputSystem:");
- if (config.inputSystem)
- {
- GUILayout.Label("Authorized", label_Green);
- }
- else
- {
- GUILayout.Label("Unauthorized", label_Red);
- }
- GUILayout.FlexibleSpace();
- GUILayout.EndHorizontal();
- GUILayout.BeginHorizontal();
- GUILayout.Label("ImageTracking:");
- if (config.imageTracking)
- {
- GUILayout.Label("Authorized", label_Green);
- }
- else
- {
- GUILayout.Label("Unauthorized", label_Red);
- }
- GUILayout.FlexibleSpace();
- GUILayout.EndHorizontal();
- GUILayout.BeginHorizontal();
- GUILayout.Label("ObjectDetection:");
- if (config.objectDetection)
- {
- GUILayout.Label("Authorized", label_Green);
- }
- else
- {
- GUILayout.Label("Unauthorized", label_Red);
- }
- GUILayout.FlexibleSpace();
- GUILayout.EndHorizontal();
- GUILayout.BeginHorizontal();
- GUILayout.Label("QRScanner:");
- if (config.qrScanner)
- {
- GUILayout.Label("Authorized", label_Green);
- }
- else
- {
- GUILayout.Label("Unauthorized", label_Red);
- }
- GUILayout.FlexibleSpace();
- GUILayout.EndHorizontal();
- GUILayout.FlexibleSpace();
- }
- GUILayout.EndVertical();
- }
- GUILayout.EndHorizontal();
- }
- }
|