Beispiel #1
0
    private IEnumerator OnRoundBegin_Internal()
    {
        yield return(new WaitForEndOfFrame()); // Wait for end of frame in order to let the animator play the K_ROUND_ENTRY_ANIM

        float startRoundUIDelay = 0f;

        if (ScenesConfig.GetUISettings().m_IsCounterEnabled)
        {
            startRoundUIDelay = m_GameConfig.m_StartRoundUIDelay;
            yield return(new WaitForSeconds(startRoundUIDelay));

            PlayStartRoundNotification();

            yield return(new WaitForSeconds(m_GameConfig.m_RoundEntryTime - startRoundUIDelay));
        }

        while (!ArePlayersReady())
        {
            // Player's not ready yet, wait one more second
            yield return(new WaitForSeconds(1f));
        }

        foreach (GameObject player in GameManager.Instance.GetPlayers())
        {
            EnablePlayer(player, true);
        }

        m_RoundIsBegin      = true;
        m_LastRoundTimeOver = false;
        OnRoundBegin?.Invoke();
    }
Beispiel #2
0
    protected override void Awake()
    {
        base.Awake();
        m_RoundSubGameManager = GameManager.Instance.GetSubManager <RoundSubGameManager>(ESubManager.Round);
        m_RoundSubGameManager.RegisterRoundComponent(this);
        RoundSubGameManager.OnRoundVictoryCounterChanged += UpdateVictoryCounters;
        RoundSubGameManager.OnRoundBegin += OnRoundBegin;

        m_UISettings = ScenesConfig.GetUISettings();
    }
Beispiel #3
0
    void UpdateVictoryCounters()
    {
        if (ScenesConfig.GetUISettings().m_IsCounterEnabled)
        {
            uint player1VictoryCounter = m_RoundSubGameManager.GetPlayerRoundVictoryCounter(EPlayer.Player1);
            for (int i = 0; i < m_Player1VictoryRounds.Length; i++)
            {
                m_Player1VictoryRounds[i].enabled = (player1VictoryCounter > i);
            }

            uint player2VictoryCounter = m_RoundSubGameManager.GetPlayerRoundVictoryCounter(EPlayer.Player2);
            for (int i = 0; i < m_Player2VictoryRounds.Length; i++)
            {
                m_Player2VictoryRounds[i].enabled = (player2VictoryCounter > i);
            }
        }
    }