Hello,
I have made a game with a scene that contains a timer, here is the script.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class UITimer : MonoBehaviour
{
public Text timerLabel;
private float time;
void Update()
{
time += Time.deltaTime;
var minutes = time / 60;
var seconds = time % 60;
var fraction = (time * 100) % 100;
timerLabel.text = string.Format("{0:00} : {1:00} : {2:000}", minutes, seconds, fraction);
}
}
I need it so that when the playing loses that level, whatever time you got goes into another scene in a text box and says, "You Failed/Won in x min x sec"!
Thanks,
Studio 9!
↧