// Jimmy Vegas Unity Tutorials // This Script will create your global scripts using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class GlobalScore : MonoBehaviour { public GameObject scoreBox; public static int currentScore; public int internalScore; void Update () { internalScore = currentScore; scoreBox.GetComponent().text = "" + internalScore; } } using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class GlobalTimer : MonoBehaviour { public GameObject timeDisplay01; public GameObject timeDisplay02; public bool isTakingTime = false; public int theSeconds = 150; void Update () { if (isTakingTime == false) { StartCoroutine(SubtractSecond()); } } IEnumerator SubtractSecond () { isTakingTime = true; theSeconds -= 1; timeDisplay01.GetComponent().text = "" + theSeconds; timeDisplay02.GetComponent().text = "" + theSeconds; yield return new WaitForSeconds(1); isTakingTime = false; } }