18 lines
347 B
C#
18 lines
347 B
C#
![]() |
using UnityEngine;
|
||
|
|
||
|
public class ChaseCoin : MonoBehaviour
|
||
|
{
|
||
|
public int coinValue = 1;
|
||
|
|
||
|
void OnTriggerEnter(Collider other)
|
||
|
{
|
||
|
|
||
|
if (other.CompareTag("Player"))
|
||
|
{
|
||
|
Debug.Log("ChaseCoin");
|
||
|
FindObjectOfType<ChaseScoreManager>().AddScore(coinValue);
|
||
|
Destroy(gameObject);
|
||
|
}
|
||
|
}
|
||
|
}
|