Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Timer logic
- float seconds = 60f;
- int minutes = 2;
- bool startCountDownTimer = false;
- bool battleEnd = false;
- void RoundOneTimerCountdown()
- {
- seconds -= Time.deltaTime;
- battleCounter.text = minutes.ToString() + " : " + Mathf.Round(seconds).ToString();
- if (seconds <= 1)
- {
- if(seconds <= 1 && minutes == 2)
- {
- seconds = 59;
- minutes = 1;
- }
- if(minutes == 1 && seconds <= 1)
- {
- seconds = 59;
- minutes = 0;
- }
- if (minutes == 0 && seconds <= 0)
- {
- seconds = 00;
- minutes = 0;
- if(!battleEnd)
- {
- GameObject.Find("NetworkManager").GetComponent<GameNetworkManager>().EndBattleByTimer();
- battleEnd = true;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement