123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- 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 MQTTSettings
- {
- [MenuItem("GHZ/GHZXRPackage/MQTT")]
- public static void MQTTInit()
- {
- Debug.Log("MQTTInit");
- PlayerSet();
- }
- static void PlayerSet()
- {
- try
- {
- FileUtil.DeleteFileOrDirectory("Assets/MQTT");
- }
- catch
- {
- }
- string[] strlist = new string[3];
- strlist[0] = "https://gogs.ghz-tech.com:8843/GHzGlass/GHZMQTTXR.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.PlayerLiveSamplesSet(request);
- }
- }
|