Ejemplo n.º 1
0
    IEnumerator TimerTick()
    {
        GetCurrentTimer();
        SetLabel();
        do
        {
            yield return(new WaitForSeconds(1));

            if (PhotonNetwork.isMasterClient)
            {
                timeLeft--;
                NetworkLobbyHelper.SetCurrentTimer(timeLeft);
            }
            else
            {
                GetCurrentTimer();
            }
            SetLabel();
        } while (timeLeft > 0);

        lobbyView.OnStartGameButtonClicked();
    }