// Jimmy Vegas Unity Tutorials // These scripts will create a cash system and allow you to exit the shop //GlobalCash using UnityEngine.UI; public class GlobalCash : MonoBehaviour { public static int CurrentCoins = 100; public int LocalCoins; public GameObject InventoryDisplay; public GameObject ShopDisplay; void Update () { LocalCoins = CurrentCoins; InventoryDisplay.GetComponent ().text = "Coins: " + LocalCoins; ShopDisplay.GetComponent ().text = "Coins: " + LocalCoins; } } //===== //ExitShop using UnityStandardAssets.Characters.FirstPerson; public class ExitShops : MonoBehaviour { public GameObject ThePlayer; public GameObject ShopPanel; public void ExitShopMode () { ThePlayer.GetComponent ().enabled = true; ShopPanel.SetActive (false); } }