public class jinbi : MonoBehaviour
{
//这个脚本是用来计算吃到的金币的得分
float CurrentSorce;
void Start()
{
CurrentSorce = 0;
}
// Update is called once per frame
private void OnTriggerEnter(Collider other)
{
CurrentSorce += 1;
Debug.Log("有人碰到金币,他叫:" + other.name + "开始加分,当前分数:" + CurrentSorce);
Destroy(other.gameObject);
}
}