全息远程处理 (Holographic Remoting) 接口允许您将应用程序连接到远程全息设备,并在应用程序和该设备之间流式传输数据。
// Connnect to remote holographic device
using System.Collections; using UnityEngine; using UnityEngine.XR; using UnityEngine.XR.WSA;
public class ExampleClass : MonoBehaviour { private string IP;
private bool connected;
public void Connect() { if (HolographicRemoting.ConnectionState != HolographicStreamerConnectionState.Connected) { HolographicRemoting.Connect(IP); } }
void Update() { if (!connected && HolographicRemoting.ConnectionState == HolographicStreamerConnectionState.Connected) { connected = true;
StartCoroutine(LoadDevice("WindowsMR")); } }
IEnumerator LoadDevice(string newDevice) { XRSettings.LoadDeviceByName(newDevice); yield return null; XRSettings.enabled = true; } }
ConnectionState | 应用程序是否正在显示受保护的内容。 |