// Update is called once per frame
    void Update()
    {
        int coinCount = coinCounter.getCoinCount();

        Text text = GetComponent <Text>();

        text.text = coinCount.ToString();
    }
Пример #2
0
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.tag == "Player")
     {
         coinCounter.setCointCount(coinCounter.getCoinCount() + 1);
         gameObject.SetActive(false);
     }
 }