void Start() { //Score sættes fra start til 0 gamePoints = FindObjectOfType(typeof(UI_GamePoints)) as UI_GamePoints; if (gamePoints == null) { Debug.LogError("Du mangler at tilføje \"Points\" til dit Game UI canvas. (Find objektet under \"Prefabs -> UI Objects -> Points\")"); } else { gamePoints.ResetPoints(); // Nulstiller points i starten af spillet } }
void Update() { //Load first level (Game) if (Input.GetKeyDown(KeyCode.Space)) { UI_GamePoints points = FindObjectOfType <UI_GamePoints>(); if (points != null) { points.ResetPoints(); } SceneManager.LoadScene(1); } }
void Start() { gamePoints = FindObjectOfType(typeof(UI_GamePoints)) as UI_GamePoints; // Sætter referencen til UI_GamePoints scriptet }