Віконце з монетами
Coin
public UnityEngine.UI.Text t1;
public static int a = 0;
bool was = false;
void OnTriggerEnter2D(Collider2D other)
{
if (other.tag == "Player" && was == false)
{
a++;
was = true;
t1.text = "Монет: " + a;
Destroy(gameObject);
}
}
[ Монети без UI ]