Post time at the end of the level
Hello, I have created a timer for my game and I want it to post it when the level ends or the player dies in a different scene. Can anyone help me ?
This is my timer code if it helps anyone :
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class Timer : MonoBehaviour {
public Text counterText;
public float seconds , minutes;
// Use this for initialization
void Start () {
counterText = GetComponent<Text> () as Text;
}
// Update is called once per frame
void Update () {
minutes=(int)(Time.timeSinceLevelLoad/60f);
seconds=(int)(Time.timeSinceLevelLoad%60f);
counterText.text = minutes.ToString("00")+ ":" + seconds.ToString("00");
}
}
Comment