public Text buyText; // This is the text attached to the item // Start is called before the first frame update void Start() { playerInventory = GameObject.Find("Inventory").GetComponent <money_script>(); // This finds the player's inventory buyText.text = "$" + price; // This displays the price under the item }
public GameObject spawn; // This is the object that is spawned // Start is called before the first frame update void Start() { playerInventory = GameObject.Find("Inventory").GetComponent <money_script>(); // We find the player's inventory }