Exemple #1
0
    private void StartGame()
    {
        if (isStart == true)
        {
            return;
        }
        isStart = true;

        for (int i = 0; i < selecters.Length; ++i)
        {
            selecters[i].OnSelected(false, "");
        }


        TeamController.Teams.Clear();

        var totalCnt = plCnt + cpuCnt;

        switch (uiReadyController.gameMode)
        {
        case GameMode.Personal:
            for (int i = 0; i < totalCnt; ++i)
            {
                TeamController.AddPlayerInTeam(i + 1, ((i + 1 <= plCnt) ? false : true), i + 1, characterTypeList[i]);
            }
            break;

        case GameMode.Team:
            // case 1: team, pl1 -> 2(p1, cpu)vs(cpu, cpu)
            if (uiReadyController.howPlayer == HowPlayer.P1)
            {
                TeamController.AddPlayerInTeam(1, false, 1, characterTypeList[0]);
                TeamController.AddPlayerInTeam(1, true, 2, characterTypeList[1]);
                TeamController.AddPlayerInTeam(2, true, 3, characterTypeList[2]);
                TeamController.AddPlayerInTeam(2, true, 4, characterTypeList[3]);
            }
            else if (uiReadyController.howPlayer == HowPlayer.P2)
            {
                if (uiReadyController.versusMode == P2TeamMode.PL2vsCP2)
                {
                    TeamController.AddPlayerInTeam(1, false, 1, characterTypeList[0]);
                    TeamController.AddPlayerInTeam(1, false, 2, characterTypeList[1]);
                    TeamController.AddPlayerInTeam(2, true, 3, characterTypeList[2]);
                    TeamController.AddPlayerInTeam(2, true, 4, characterTypeList[3]);
                }
                else if (uiReadyController.versusMode == P2TeamMode.PLCPvsPLCP)
                {
                    TeamController.AddPlayerInTeam(1, false, 1, characterTypeList[0]);
                    TeamController.AddPlayerInTeam(1, true, 2, characterTypeList[1]);
                    TeamController.AddPlayerInTeam(2, false, 3, characterTypeList[2]);
                    TeamController.AddPlayerInTeam(2, true, 4, characterTypeList[3]);
                }
            }
            break;

        default:
            break;
        }

        for (int i = 0; i < TeamController.Teams.Count; ++i)
        {
            Debug.Log(TeamController.Teams[i].Players[0].SelectedCharacter.ToString());
        }

        SceneUtil.LoadScene("InGame");
    }