//Jimmy Vegas Unity Tutorial //These scripts are for the collectibles using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class GlobalScore : MonoBehaviour { public GameObject scoreDisplay; public static int scoreValue = 0; public int internalScore; void Update() { internalScore = scoreValue; scoreDisplay.GetComponent().text = "" + scoreValue; } } using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class GoldCollect : MonoBehaviour { public GameObject goldIngots; public AudioSource collectSound; public GameObject pickUpDisplay; void OnTriggerEnter(Collider other) { GlobalScore.scoreValue += 500; goldIngots.SetActive(false); collectSound.Play(); GetComponent().enabled = false; pickUpDisplay.SetActive(false); pickUpDisplay.GetComponent().text = "GOLD INGOTS"; pickUpDisplay.SetActive(true); } }