he Holographic Remoting interface allows you to connect an application to a remote holographic device, and stream data between the application and that device.
// 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 | Whether the app is displaying protected content. |