private void Update() { EmulationMode mode = this.m_Mode; if (mode != EmulationMode.Simulated) { if (mode == EmulationMode.RemoteDevice) { HolographicStreamerConnectionState connectionState = this.m_ConnectionState; this.m_ConnectionState = PerceptionRemotingPlugin.GetConnectionState(); if (connectionState != this.m_ConnectionState) { base.Repaint(); } HolographicStreamerConnectionFailureReason holographicStreamerConnectionFailureReason = PerceptionRemotingPlugin.CheckForDisconnect(); if (holographicStreamerConnectionFailureReason == HolographicStreamerConnectionFailureReason.Unreachable || holographicStreamerConnectionFailureReason == HolographicStreamerConnectionFailureReason.ConnectionLost) { Debug.LogWarning("Disconnected with failure reason " + holographicStreamerConnectionFailureReason + ", attempting to reconnect."); this.Connect(); } else if (holographicStreamerConnectionFailureReason != HolographicStreamerConnectionFailureReason.None) { Debug.LogError("Disconnected with error " + holographicStreamerConnectionFailureReason); } } } else { PerceptionSimulation.SetGestureHand(this.m_Hand); } }
private void Update() { switch (this.m_Mode) { case EmulationMode.Simulated: PerceptionSimulation.SetGestureHand(this.m_Hand); break; case EmulationMode.RemoteDevice: { HolographicStreamerConnectionState connectionState = this.m_ConnectionState; this.m_ConnectionState = PerceptionRemotingPlugin.GetConnectionState(); if (connectionState != this.m_ConnectionState) { base.Repaint(); } HolographicStreamerConnectionFailureReason reason = PerceptionRemotingPlugin.CheckForDisconnect(); if ((reason == HolographicStreamerConnectionFailureReason.Unreachable) || (reason == HolographicStreamerConnectionFailureReason.ConnectionLost)) { Debug.LogWarning("Disconnected with failure reason " + reason + ", attempting to reconnect."); this.Connect(); } else if (reason != HolographicStreamerConnectionFailureReason.None) { Debug.LogError("Disconnected with error " + reason); } break; } } }
private void OnGUI() { if (!this.CheckOperatingSystem()) { EditorGUILayout.HelpBox("You must be running Windows build 14318 or later to use Holographic Simulation or Remoting.", MessageType.Warning); } else if (!this.IsHoloLensCurrentTarget()) { EditorGUILayout.HelpBox("You must enable Virtual Reality support in settings and add Windows Holographic to the devices to use Holographic Emulation.", MessageType.Warning); } else { EditorGUILayout.Space(); EditorGUI.BeginDisabledGroup(this.m_InPlayMode); this.DrawRemotingMode(); EditorGUI.EndDisabledGroup(); EmulationMode mode = this.m_Mode; if (mode != EmulationMode.RemoteDevice) { if (mode == EmulationMode.Simulated) { EditorGUI.BeginChangeCheck(); this.m_RoomIndex = EditorGUILayout.Popup(HolographicEmulationWindow.s_RoomText, this.m_RoomIndex, HolographicEmulationWindow.s_RoomStrings, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck() && this.m_InPlayMode) { this.LoadCurrentRoom(); } EditorGUI.BeginChangeCheck(); this.m_Hand = (GestureHand)EditorGUILayout.Popup(HolographicEmulationWindow.s_HandText, (int)this.m_Hand, HolographicEmulationWindow.s_HandStrings, new GUILayoutOption[0]); if (EditorGUI.EndChangeCheck()) { PerceptionSimulation.SetGestureHand(this.m_Hand); } } } else { EditorGUI.BeginDisabledGroup(this.m_ConnectionState != HolographicStreamerConnectionState.Disconnected); this.RemotingPreferencesOnGUI(); EditorGUI.EndDisabledGroup(); this.ConnectionStateGUI(); } } }