using UnityEngine; using System.Collections; using UnityEngine.UI; public class GameController : MonoBehaviour { public Text scoreTekst; private int huidigeScore; // Use this for initialization void Start () { huidigeScore = 0; } // Update is called once per frame void Update () { if (scoreTekst) { scoreTekst.text = huidigeScore.ToString(); } } public void VerhoogScore(int hoeveel) { huidigeScore += hoeveel; } public void VerlaagScore(int hoeveel) { huidigeScore -= hoeveel; } public void SpelerIsDood() { StartCoroutine(LaadSpelOpnieuw()); } IEnumerator LaadSpelOpnieuw() { yield return new WaitForSeconds (1); Application.LoadLevel (Application.loadedLevel); //SceneManager.LoadScene ("Scene 1"); } }