void Update() { switch (m_Mode) { case EmulationMode.Simulated: HolographicEmulation.SetGestureHand(m_Hand); break; case EmulationMode.RemoteDevice: HolographicStreamerConnectionState connectionState = PerceptionRemotingPlugin.GetConnectionState(); if (connectionState != m_LastConnectionState) { Repaint(); } var lastConnectionFailureReason = PerceptionRemotingPlugin.CheckForDisconnect(); if (lastConnectionFailureReason == HolographicStreamerConnectionFailureReason.Unreachable || lastConnectionFailureReason == HolographicStreamerConnectionFailureReason.ConnectionLost) { Debug.LogWarning("Disconnected with failure reason " + lastConnectionFailureReason + ", attempting to reconnect."); Connect(); } else if (lastConnectionFailureReason != HolographicStreamerConnectionFailureReason.None) { Debug.LogError("Disconnected with error " + lastConnectionFailureReason); } m_LastConnectionState = connectionState; break; } }
private void Update() { EmulationMode mode = this.m_Mode; if (mode != EmulationMode.Simulated) { if (mode == EmulationMode.RemoteDevice) { HolographicStreamerConnectionState connectionState = PerceptionRemotingPlugin.GetConnectionState(); if (connectionState != this.m_LastConnectionState) { 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); } this.m_LastConnectionState = connectionState; } } else { HolographicEmulation.SetGestureHand(this.m_Hand); } }