GetConnectionState() static private méthode

static private GetConnectionState ( ) : HolographicStreamerConnectionState
Résultat HolographicStreamerConnectionState
Exemple #1
0
        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 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);
            }
        }