Ejemplo n.º 1
0
 public void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
Ejemplo n.º 2
0
 IEnumerator Timer()
 {
     while (true)
     {
         currTime += Time.deltaTime;
         if (currTime >= 10.0)
         {
             GameManager.Instance.startGame = true;
         }
         if (PhotonNetwork.LocalPlayer.IsMasterClient)
         {
             if (currTime >= 180)
             {
                 InOutGameRoomInfo.Instance.isSettlement = true;
                 currTime = 0;
                 InOutGameRoomInfo.Instance.ExitGameRound();
                 break;
             }
             GameObject generatorGO = GameObject.Find("Infinitive Bomb Generator");
             if (infiniteBombGenerator == null && generatorGO != null)
             {
                 infiniteBombGenerator = generatorGO.GetComponent <BombGeneratorOnline>();
             }
             if (infiniteBombGenerator != null)
             {
                 infiniteBombGenerator.bombsFallingNumber = (int)(currTime / 90 * 10 + 10);
             }
         }
         if (PhotonNetwork.LocalPlayer.IsMasterClient)
         {
             timerUI.SetTime((int)(180 - currTime));
             photonView.RPC("SyncTimer", RpcTarget.Others, (int)(180 - currTime));
         }
         yield return(new WaitForEndOfFrame());
     }
 }