示例#1
0
    private IEnumerator StartGame(GameBase.GameMode gameMode)
    {
        // ゲームモード送信
        NetworkGameManager.Instance.LocalPlayer.CmdSetGameMode(gameMode);
        // 乱数シード送信
        NetworkGameManager.Instance.LocalPlayer.CmdRandomSeed((int)(Random.value * int.MaxValue));

        PlayerController[] bots = NetworkGameManager.Instance.GetBots(true);
        foreach (PlayerController bot in bots)
        {
            bot.CmdSetGameMode(gameMode);
            bot.CmdRandomSeed((int)(Random.value * int.MaxValue));
        }

        // 同期待機開始
        NetworkGameManager.Instance.StandbySync();

        // 同期完了まで待機
        while (!NetworkGameManager.Instance.IsCompleateSync())
        {
            yield return(null);
        }

        GameManager.Instance.RequestUnloadScene("DebugModeSelect");
        GameManager.Instance.RequestAddScene("Battle", true);
        GameManager.Instance.ApplySceneRequests();
    }
示例#2
0
 public void CmdSetGameMode(GameBase.GameMode mode)
 {
     m_GameMode = mode;
 }