Add CollectCoins

This commit is contained in:
xixu-me committed 2025-03-20 18:49:44 +08:00
1 parent c404a1c315
commit 75cf61f5a9
482 files changed
+19548

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
using UnityEngine;
using System.Collections;
public class CoinScript : MonoBehaviour {
public float rotationSpeed = 100.0f;
void Start () {
}
// Update is called once per frame
void Update () {
transform.Rotate(0, 0, rotationSpeed * Time.deltaTime);
}
void OnTriggerEnter(Collider collider)
{
if (collider.gameObject.tag == "Player")
{
collider.SendMessage("pickup");
Destroy(this.gameObject);
}
}
}