コード例 #1
0
        private void OnCancel()
        {
            switch (serverState)
            {
            case SERVER_STATE.HOST:
            {
                networkManager.StopHost();
                break;
            }

            case SERVER_STATE.CLIENT:
            {
                networkManager.StopHost();
                break;
            }

            case SERVER_STATE.SERVER:
            {
                networkManager.StopServer();
                break;
            }

            default:
            {
                DebugLog.Console("Something went wrong. Cancel button clicked with no server state.");
                break;
            }
            }
            ShowMainServerButtons();
            serverState = SERVER_STATE.NONE;
        }
コード例 #2
0
        private void StartHost()
        {
            networkManager.StartHost();
            DebugLog.Console("Starting Host");
            cancelButton.Title = "Stop Host";

            HideMainServerButtons();
            serverState = SERVER_STATE.HOST;
        }
コード例 #3
0
        private void StartServer()
        {
            networkManager.StartServer();
            DebugLog.Console("Starting Server");
            cancelButton.Title = "Stop Server";

            HideMainServerButtons();
            serverState = SERVER_STATE.SERVER;
        }
コード例 #4
0
        private void StartClient()
        {
            networkManager.StartClient();
            DebugLog.Console("Starting Client");
            cancelButton.Title = "Stop Client";

            HideMainServerButtons();
            serverState = SERVER_STATE.CLIENT;
        }