You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
618 B

using Photon.Pun;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class StartCountdown : MonoBehaviour {
public Text countdownText;
private float current;
private bool counting;
void Update() {
if (counting) {
countdownText.text = current.ToString("0.0");
current -= Time.deltaTime;
if (current <= 0)
CountdownDone();
}
}
private void CountdownDone() {
counting = false;
gameObject.SetActive(false);
RoomManager.Instance.StartSelection();
}
public void StartCount(int time) {
current = time;
counting = true;
}
}