コード例 #1
0
        /// <summary>
        /// UI Callback for when the player clicks the button
        /// to start hosting a new game
        /// </summary>
        public void UIClickStartHost()
        {
            string    mapData = "";
            TextAsset assetData;

            switch (mapOptions[HostMap.value].text)
            {
            case "Small Level":
                assetData = Resources.Load <TextAsset>("map_a");
                mapData   = assetData.text;
                break;

            case "Bigger Level":
                assetData = Resources.Load <TextAsset>("map_b");
                mapData   = assetData.text;
                break;
            }

            GameDataMessage game = new GameDataMessage();

            game.maxPlayers = HostMaxPlayers.value + 1;
            game.levelJSON  = mapData;

            PlayerDataMessage player = new PlayerDataMessage();

            player.callsign = HostCallsign.text;

            GameController.StartHost(HostMaxPlayers.value + 1, game, player);
        }
コード例 #2
0
ファイル: UI_StartMenu.cs プロジェクト: zaun/tank
        /// <summary>
        /// UI Callback for when the player clicks the button
        /// to start hosting a new game
        /// </summary>
        public void UIClickStartHost()
        {
            GameDataMessage game = new GameDataMessage();

            game.maxPlayers = HostMaxPlayers.value + 1;

            PlayerDataMessage player = new PlayerDataMessage();

            player.callsign = HostCallsign.text;

            GameController.StartHost(HostMaxPlayers.value + 1, game, player);
        }