I am creating my first project in Unity, a prototype of a video game using C #. It's almost ready but I only need the points marker. At the moment I have done this:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Puntuacion : MonoBehaviour {
public float TiempoJugando = 0;
public int Tiempo;
public TextMesh marcador;
void Start()
{
Tiempo = 0;
}
void Update ()
{
TiempoJugando = Time.time;
Tiempo = (int)TiempoJugando;
Debug.Log(Tiempo);
marcador.text = Tiempo.ToString();
}
}
The problem is that when the character dies, this is still active and if you press to play again, he continues to count as if he had never finished the game. Does anyone know how to fix it? Thank you very much!