示例#1
0
    internal void SetTestName(string name)
    {
        TestsList testsList = TestReader.GetTestList(name);

        ResetTest();
        EditTest(testsList);
    }
示例#2
0
    // This is called from start and will run each phase of the game one after another. ONLY ON SERVER (as Start is only called on server)
    private IEnumerator GameLoop()
    {
        while (m_Players.Count < 1)//LobbyManager.s_Singleton.numPlayers)
        {
            yield return(null);
        }

        while (!AllPlayersReady())
        {
            RpcCheckReady();
            yield return(m_LoadingWait);
        }

        //Hack_SetupTestList();
        //TestReader.SaveTestList("test", m_currentTestList);
        //PlayFab.Internal.
        m_currentTestList = TestReader.GetTestList(m_testListName);
        if (m_currentTestList == null)
        {
            RpcShowMessageAll(FILE_NOT_FOUND);
            yield return(new WaitForSeconds(m_endGameWaitingTime));

            LobbyManager.s_Singleton.ServerReturnToLobby();
        }
        m_currentTestList.InitTests();

        RpcSetupGame(m_currentTestList.m_countOfRounds);

        while (m_currentTestList.IsRoundAvaliable())
        {
            // Start off by running the 'RoundStarting' coroutine but don't return until it's finished.
            yield return(StartCoroutine(RoundStarting()));

            // Once the 'RoundStarting' coroutine is finished, run the 'RoundPlaying' coroutine but don't return until it's finished.
            yield return(StartCoroutine(RoundPlaying()));

            // Once execution has returned here, run the 'RoundEnding' coroutine.
            yield return(StartCoroutine(RoundEnding()));

            m_currentTestList.SetTestsForNextRound();
        }

        m_GameWinnerId = GetGameWinnerId();
        RpcEndGame(m_GameWinnerId);
        UpdatePlayfabScore();
        yield return(new WaitForSeconds(m_endGameWaitingTime));

        ShowResultScreen();
    }