// Update is called once per frame void Update() { int coinCount = coinCounter.getCoinCount(); Text text = GetComponent <Text>(); text.text = coinCount.ToString(); }
void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { coinCounter.setCointCount(coinCounter.getCoinCount() + 1); gameObject.SetActive(false); } }