1.GunManager.cs 手枪管理器
该脚本挂载在手枪上,根据鼠标在屏幕上的位置,相对应的旋转手枪
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GunManager : MonoBehaviour
{
//最大和最小的X,Y轴的旋转角度
private float maxYRotation = 120;
private float minYRotation = 0;
private float maxXRotation = 60;
private float minXRotation = 0;
//射击的间隔时长
private float shootTime = 1;
//射击间隔时间的计时器
private float shootTimer