public void OnTriggerEnter(Collider thing) { //on désactive la piece coin.SetActive(false); //on maj le score score.AddCoin(); }
void OnTriggerEnter2D(Collider2D boxCollider2D) { if (boxCollider2D.CompareTag("Player")) { Debug.Log("The player has picked a coin"); score.AddCoin(); pickupObject.SetActive(false); } }