// Jimmy Vegas Unity Tutorial // This script will create your baker button using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class GlobalBaker : MonoBehaviour { public GameObject fakeButton; public GameObject fakeText; public GameObject realButton; public GameObject realText; public int currentCash; public static int bakerValue = 50; public static bool turnOffButton = false; void Update () { currentCash = GlobalCash.CashCount; fakeText.GetComponent().text = "Buy Baker - $" + bakerValue; realText.GetComponent().text = "Buy Baker - $" + bakerValue; if (currentCash >= bakerValue) { fakeButton.SetActive(false); realButton.SetActive(true); } if (turnOffButton == true) { realButton.SetActive(false); fakeButton.SetActive(true); turnOffButton = false; } } }