feat: scene built, basic function completed

This commit is contained in:
2026-07-03 22:06:54 +08:00
parent 1995835c12
commit 99bcfccc94
8 changed files with 221 additions and 191 deletions

View File

@@ -0,0 +1,24 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraControllerY : MonoBehaviour
{
[SerializeField]
private float mouseSpeed = 500f;
private float pitch = 0f;
// Update is called once per frame
void Update()
{
float mouseY = Input.GetAxis("Mouse Y");
pitch -= mouseY * mouseSpeed * Time.deltaTime;
pitch = Mathf.Clamp(pitch, -90f, 30f);
transform.localRotation = Quaternion.Euler(pitch, 0f, 0f);
}
}