Hi,
My first post here:) I have a problem with displaying time used in next scene. If you reach 20 points scene changes and the time stops. Only problem is that i don´t know how to display “end time” in next scene. I know how to display score in next scene but I would also like to display time used in the first scene. I tried “dontdestroyonload” but the result is not what I hoped. End time is saved but it is in the wrong place in the scene and also it is saved through rest of the scenes. Here is my Timer code.
public class Timer : MonoBehaviour {
public float myTimer = 0;
private Text timerText;
private bool timerIsActive = true;
void Start(){
timerText = GetComponent<Text> ();
}
void Update (){
if (timerIsActive) {
myTimer += Time.deltaTime;
timerText.text = myTimer.ToString ("f0");
if (ScoreManager.score >= 20) {
timerIsActive = false;
}
}
}
}