将C#赋予枪
代码如下:
public class guncontral : MonoBehaviour
{
//枪口火焰生成位置
public Transform firepoint;
//枪口火焰物体
public GameObject fireper;
//子弹生成位置
public Transform bulletpoint;
//子弹物体
public GameObject bulletper;
//子弹个数
private int bulletCount = 10;
// 开火间隔
private float cd = 0.2f;
//实际开火的时间 计时器
private float timer = 0;
private AudioSource gunvoice;
public AudioClip clip;
// Start is called before the first frame update
void Start()
{
gunvoice = GetComponent<Au