123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEditor;
- using UnityEditor.PackageManager.Requests;
- using UnityEditor.PackageManager;
- using PackageInfo = UnityEditor.PackageManager.PackageInfo;
- using System;
- using System.IO;
- namespace Ximmerse.XR
- {
-
-
-
- public static class SDKEditorUtility
- {
-
-
-
- public static string kPluginFolderAssetPath
- {
- get; private set;
- }
-
-
-
- public static string kPluginFolderResolvePath
- {
- get; private set;
- }
-
-
-
- public static string kPluginTrackingProfilePath
- {
- get; private set;
- }
- public const string kXimmerseXRPackageName = "com.ximmerse.xr";
-
-
-
- public const string kTrackingProfileRelativePath = "/TrackingProfiles";
-
-
-
- public static string kTrackingProfileResolvePath
- {
- get => kPluginFolderResolvePath + kTrackingProfileRelativePath;
- }
- [InitializeOnLoadMethod]
- static void InitializeEditor()
- {
- var pkg = GetXimmerseXRSDKPackageInfo();
- if (pkg != null)
- {
- kPluginFolderAssetPath = pkg.assetPath;
- kPluginFolderResolvePath = pkg.resolvedPath;
- kPluginTrackingProfilePath = pkg.assetPath + kTrackingProfileRelativePath;
-
- }
- }
-
-
-
-
- public static PackageInfo GetXimmerseXRSDKPackageInfo()
- {
- ListRequest list = Client.List(offlineMode: true);
- while (!list.IsCompleted)
- {
- }
- foreach (PackageInfo packageInfo in list.Result)
- {
- if (packageInfo.name.Equals(kXimmerseXRPackageName, StringComparison.OrdinalIgnoreCase))
- {
- return packageInfo;
- }
- }
- return default(PackageInfo);
- }
- }
- }
|