public class Player : MonoBehaviour {
public GameObject _prefabBullet;
private float _angleSpeed = 120f;
void Update() {
float eularY = Input.GetAxis("Mouse X") * _angleSpeed * Time.deltaTime;
transform.Rotate(new Vector3(0, eularY, 0));
if (Input.GetMouseButtonDown(0)) {
Instantiate(_prefabBullet, transform.position, transform.rotation);
}
}
}
写一个角色控制器,鼠标控制屏幕晃动,鼠标控制开枪。
最新推荐文章于 2022-02-13 16:42:28 发布