Hi, I am new to C# and made a simple block dodge game. I was wondering how to add a scoring system using the game time. The concept I was thinking of would have a timer at the top of the scene and when you die you change scenes to the Game Over scene where the score will be displayed in seconds. However I have some issues creating the script. This is the script I am using to change the screens on contact with a block. Is there any way I can make the scoring system work? If yes please tell me. Thanks
using UnityEngine;
using System.Collections;
public class LoadNewArea : MonoBehaviour {
public string levelToLoad;
public string exitPoint;
private PlayerController thePlayer;
// Use this for initialization
void Start () {
thePlayer = FindObjectOfType<PlayerController>();
}
// Update is called once per frame
void Update () {
}
void OnTriggerEnter2D(Collider2D other) {
if(other.gameObject.name == "Player")
{
Application.LoadLevel(levelToLoad);
thePlayer.startPoint = exitPoint;
}
}
}