//Jimmy Vegas Unity Tutorial //These scripts are for your lives and recycle scene using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class GlobalLife : MonoBehaviour { public GameObject lifeDisplay; public static int lifeValue = 3; public int internalLife; void Update() { internalLife = lifeValue; lifeDisplay.GetComponent().text = "" + lifeValue; } } using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class RecycleLevel : MonoBehaviour { public GameObject gameOver; void Start() { GlobalLife.lifeValue -= 1; if (GlobalLife.lifeValue == 0) { gameOver.SetActive(true); } else { SceneManager.LoadScene(2); } } }