private void Start() { scrollingUIControl = IScrollingSessionListUIController.Instance; textMesh = transform.parent.GetComponentInChildren <TextMesh>(); textMaterial = textMesh.GetComponent <MeshRenderer>().material; textColorId = Shader.PropertyToID("_Color"); textMaterial.SetColor(textColorId, Color.grey); networkDiscovery = INetworkDiscovery.Instance; }
private void Start() { // On the immersive device the UI is best placed a little closer than on a HoloLens #if UNITY_WSA && UNITY_2017_2_OR_NEWER if (UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque) { gameObject.GetComponent <SimpleTagalong>().TagalongDistance = 1; } #endif // Register for events when sessions are found / joined. networkDiscovery = INetworkDiscovery.Instance; networkDiscovery.SessionListChanged += NetworkDiscovery_SessionListChanged; networkDiscovery.ConnectionStatusChanged += NetworkDiscovery_ConnectionStatusChanged; ScrollSessions(0); }
private void Start() { networkDiscovery = INetworkDiscovery.Instance; #if UNITY_WSA && UNITY_2017_2_OR_NEWER if (UnityEngine.XR.WSA.HolographicSettings.IsDisplayOpaque && !Application.isEditor) { Debug.Log("Only HoloLens can host for now"); Destroy(gameObject); } #else if (Application.isEditor) { Debug.Log("Only HoloLens can host for now"); Destroy(gameObject); } #endif }
void Awake() { networkDiscovery = INetworkDiscovery.Instance; anchorManager = UNetAnchorManager.Instance; }