Beispiel #1
0
        private void Go()
        {
            Networking.networkReset += RemoveSocketReference;

            if (proximityBasedUpdates)
            {
                socket.MakeProximityBased(proximityDistance);
            }

            socket.serverDisconnected += delegate(string reason)
            {
                MainThreadManager.Run(() =>
                {
                    Debug.Log("The server kicked you for reason: " + reason);
#if UNITY_EDITOR
                    UnityEditor.EditorApplication.isPlaying = false;
#endif
                });
            };

            if (socket.Connected)
            {
                MainThreadManager.Run(LoadScene);
            }
            else
            {
                socket.connected += LoadScene;
            }
        }