Пример #1
0
        //---------------------------------------------------------------------

        // Call on the client when server connection successfully established
        private void OnConnectedToServer()
        {
            Debug.Log("Server connection successfully established.");

            if (this.uiManager.useCoherentUI)
            {
                this.uiManager.switchGameUI();
            }
            else
            {
                this.uiManager.diposeStartScreen();
            }

            this.sceneManager.loadScene(this.sceneManager.getDefaultStartScene());
            NetworkManager.getInstance().isActiveConnection = true;

            // Set StateSync Sender as Owner
            WbCompStateSyncSending.getInstance().setAsOwner();
        }
        //---------------------------------------------------------------------
        // Mono Behaviour
        //---------------------------------------------------------------------

        public void Awake()
        {
            WbCompStateSyncSending.instance = this;
        }