Start Game Before Time
using System.Collections;
using UnityEngine.UI;
using UnityEngine;
using UnityEngine.SceneManagement;
public class StartGame : MonoBehaviour
{
public float timeLeft = 3.0f;
public Text startText; // used for showing countdown from 3, 2, 1
public GameObject Image;
public GameObject count;
void Update()
{
timeLeft -= Time.deltaTime;
startText.text = (timeLeft).ToString("0");
if (timeLeft < 0)
{
Image.SetActive(true);
count.SetActive(false);
}
}
}
No comments:
Post a Comment