3 using System.Collections.Generic;
30 private int SessionIndex = 0;
45 #if UNITY_WSA && UNITY_2017_2_OR_NEWER 46 if (
UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque)
54 networkDiscovery.SessionListChanged += NetworkDiscovery_SessionListChanged;
55 networkDiscovery.ConnectionStatusChanged += NetworkDiscovery_ConnectionStatusChanged;
64 private void NetworkDiscovery_ConnectionStatusChanged(
object sender, EventArgs e)
66 gameObject.SetActive(networkDiscovery.running && !networkDiscovery.isServer);
76 private void NetworkDiscovery_SessionListChanged(
object sender, EventArgs e)
79 SessionIndex = Mathf.Min(SessionIndex, sessionList.Count);
89 void SetChildren(
bool Enabled)
91 foreach (Renderer mr
in GetComponentsInChildren<Renderer>())
96 foreach (BoxCollider bc
in GetComponentsInChildren<BoxCollider>())
109 int sessionCount = sessionList == null ? 0 : sessionList.Count;
111 SessionIndex = Mathf.Clamp(SessionIndex + Direction, 0, Mathf.Max(0, sessionCount - SessionControls.Length));
114 for (
int index = 0; index < SessionControls.Length; index++)
116 if (SessionIndex + index < sessionCount)
118 SessionControls[index].gameObject.SetActive(
true);
124 SessionControls[index].gameObject.SetActive(
false);
135 SelectedSession = sessionInfo;
145 if (SelectedSession != null && networkDiscovery.running)