2025-07-30 01:38:12 +05:00

19 lines
384 B
C#

using UnityEngine;
public class ChaseCoin : MonoBehaviour
{
public int coinValue = 1;
void OnTriggerEnter(Collider other)
{
Debug.Log("ChaseCoin0");
if (other.CompareTag("Player"))
{
Debug.Log("ChaseCoin");
FindObjectOfType<ChaseScoreManager>().AddScore(coinValue);
Destroy(gameObject);
}
}
}