Exemplo n.º 1
0
    /// <summary>
    /// ゲーム開始
    /// </summary>
    public IEnumerator StartGame(bool online)
    {
        Debug.Log("Start game(" + (online ? "Online" : "Offline") + ")");

        // オフライン
        if (!online)
        {
            // PlayerのSpawnを待つ
            while (NetworkGameManager.Instance.LocalPlayer == null)
            {
                yield return(null);
            }
            // ボットを生成
            for (int i = NetworkGameManager.Instance.PlayerCount; i < NetworkGameManager.Instance.matchSize; i++)
            {
                NetworkGameManager.Instance.SpawnBot();
            }
            // メンバーが揃うまで待機
            while (NetworkGameManager.Instance.PlayerCount < NetworkGameManager.Instance.matchSize)
            {
                yield return(null);
            }
        }

        m_Menu.SelectByName(null);

        GameManager.Instance.RequestUnloadScene("Matching");
        GameManager.Instance.RequestAddScene("DebugModeSelect", false);
        yield return(GameManager.Instance.ApplySceneRequests());
    }