//Jimmy Vegas Unity Tutorial //These scripts are for the cans of food using System.Collections; using System.Collections.Generic; using UnityEngine; public class FullHealthCollect : MonoBehaviour { public AudioSource collectSound; void OnTriggerEnter(Collider other) { GlobalHealth.healthValue = 100; collectSound.Play(); GetComponent().enabled = false; this.gameObject.SetActive(false); } } using System.Collections; using System.Collections.Generic; using UnityEngine; public class Per10HealthCollect : MonoBehaviour { public AudioSource collectSound; void OnTriggerEnter(Collider other) { if (GlobalHealth.healthValue >= 91) { GlobalHealth.healthValue = 100; } else { GlobalHealth.healthValue += 10; } collectSound.Play(); GetComponent().enabled = false; this.gameObject.SetActive(false); } }