Beispiel #1
0
 private void OnDisable()
 {
     PlayerConnectorAttribute.Disconnect(this);
     editorConnection.Unregister(EditorConnectionMessageID.Player, OnPlayerMessageReceived);
     editorConnection.DisconnectAll();
     editorConnection = null;
 }
 void OnDestroy()
 {
                 #if UNITY_2017_1_OR_NEWER
     if (editorConnection != null)
     {
         editorConnection.DisconnectAll();
     }
                 #endif
 }
 public void OnEditorDisconnect()
 {
                 #if UNITY_2017_1_OR_NEWER
     Debug.Log("Disconnect from editor called from computer");
     bSessionActive = false;
     SendDisconnectToPlayer();
     editorConnection.DisconnectAll();
                 #endif
 }
Beispiel #4
0
        void OnGUI()
        {
            string message;

            if (m_RemoteInterface.connected)
            {
                message = string.Format("Connected to remote AR device: {0}", m_RemoteInterface.playerId);
                var buttonRect = new Rect((Screen.width / 2) - 200, (Screen.height / 2) - 200, 400, 100);

                if (m_RemoteInterface.serviceRunning)
                {
                    if (GUI.Button(buttonRect, "Stop Remote AR Session"))
                    {
                        m_RemoteInterface.StopRemoteService();
                    }
                }
                else
                {
                    if (GUI.Button(buttonRect, "Start Remote AR Session"))
                    {
                        m_RemoteInterface.StartRemoteService(GetSettings());
                    }
                }
            }
            else
            {
                message = "Please connect to remote Player in the console menu.";
            }

            var boxRect = new Rect((Screen.width / 2) - 200, (Screen.height / 2) + 100, 400, 50);

            GUI.Box(boxRect, message);

            if (GUI.Button(new Rect((Screen.width / 2) - 200, Screen.height - 50, 100, 50), "Disconnect"))
            {
                m_RemoteInterface.StopRemoteService();
                m_EditorConnection.DisconnectAll();
            }
        }
Beispiel #5
0
    private void OnDestroy()
    {
#if UNITY_2017_1_OR_NEWER
        if (_editorConnection != null)
        {
            _editorConnection.DisconnectAll();
        }
#endif
        if (_recordingMode == RecordingMode.PLAYING)
        {
            _playingFileStream.Close();
        }
    }
 void OnDestroy()
 {
                 #if UNITY_2017_1_OR_NEWER
     editorConnection.DisconnectAll();
                 #endif
 }
 public void DisconnectAll() => m_Connection.DisconnectAll();