コード例 #1
0
ファイル: LoadGameSceneInit.cs プロジェクト: mmielus/Stars
    public void Create()
    {
        List <GameApp.PlayerMenu> playerMenuList = new List <GameApp.PlayerMenu>();

        foreach (GameObject player in playersToAddToGame)
        {
            string tempType;
            if (player.transform.Find("PlayerTypeInput").GetComponent <Toggle>().isOn)
            {
                tempType = "L";
            }
            else
            {
                tempType = "R";
            }
            playerMenuList.Add(new GameApp.PlayerMenu
            {
                name     = player.transform.Find("PlayerNameInput").GetComponent <InputField>().text,
                password = player.transform.Find("PlayerPassInput").GetComponent <InputField>().text,
                //race = player.transform.Find("PlayerRaceInput").GetComponent<InputField>().text,
                playerType = tempType
            });
        }

        Debug.Log("LoadGameSceneInit create, players: " + playerMenuList.Count);
        gameApp.SavePlayersFromMenu(playerMenuList);
        ServerNetworkManager serverNetworkManager = GameObject.Find("ServerNetworkManager").GetComponent <ServerNetworkManager>();

        serverNetworkManager.SetupLoadGame();
    }