Update CollectCoins

This commit is contained in:
xixu-me committed 2025-03-27 09:04:59 +08:00
1 parent 31f39cfa92
commit cbf94c4b2e
55 files changed
+271 -20

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
using UnityEngine;
using System.Collections;
public class ShotScript : MonoBehaviour {
public Rigidbody bullet;
public float force = 1000f;
public AudioClip fireSound;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
// 检测鼠标左键单击
if (Input.GetButtonDown("Fire1"))
{
Rigidbody b = Instantiate(bullet, transform.position, transform.rotation) as Rigidbody;
b.AddForce(transform.forward * force);
AudioSource.PlayClipAtPoint(fireSound, transform.position);
}
}
}