Happy new year!
I got question regarding time and score. How do I add one score every second to my scoremanager. I got button which stops the time when pressed. After the button is being pressed I would like to see time as score (int) so that I can save it to my scoreboard. Here is my timer script.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class TimerTimer: MonoBehaviour {
public Text counterText;
public float seconds, minutes;
void Start (){
counterText = GetComponent<Text> () as Text;
}
void Update(){
minutes = (int)(Time.time/60f);
seconds = (int)(Time.time % 60f);
counterText.text = minutes.ToString("0") + ":" + seconds.ToString("0");
}
}