Add CollectCoins
This commit is contained in:
1 parent
c404a1c315
commit
75cf61f5a9
482 files changed
+19548
No files matched your search
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user