1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Reflection;
- using UnityEditor;
- using UnityEngine;
- using UnityEngine.XR;
- using UnityEditor.PackageManager;
- using UnityEditor.PackageManager.Requests;
- public class YiYanPackageSettings
- {
- [MenuItem("GHZ/GHZXRPackage/YiYanPackage")]
- public static void YiYanPackageInit()
- {
- Debug.Log("YiYanPackageInit");
- PlayerSet();
- }
- static void PlayerSet()
- {
- try
- {
- FileUtil.DeleteFileOrDirectory("Assets/YiYanPackage");
- }
- catch
- {
- }
- string[] strlist = new string[1];
- strlist[0] = "https://gogs.ghz-tech.com:8843/GHzUnityModel/YiYanXR.git";
- AddAndRemoveRequest rest = Client.AddAndRemove(strlist);
- while (!rest.IsCompleted)
- {
- Debug.Log("正在加载插件包:" + rest.Status.ToString());
- System.Threading.Thread.Sleep(500);
- // 等待PackageManager请求完成
- }
- // Client.Add("com.unity.xr.openxr");
- // ListRequest request = Client.List(true);
- // LoadSamplesSettings.PlayerYiTanSamplesSet(request);
- }
- }
|