Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Scripting Help: Timer Problem

$
0
0
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!

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>