基本交互和视觉效果确定

This commit is contained in:
2025-05-18 02:23:06 +08:00
parent 3ef8e4441d
commit de34465cdf
20 changed files with 13210 additions and 56 deletions
@@ -0,0 +1,26 @@
using UnityEngine;
public class GearController : MonoBehaviour
{
[Header("齿轮参数")]
public float rotationSpeed = 360f;
public float snapDistance = 0.3f;
public float detachDistance = 10.0f;
private bool isRotating = false;
public void SetRotation(bool shouldRotate)
{
isRotating = shouldRotate;
}
private void Update()
{
if (isRotating)
{
transform.Rotate(Vector3.forward, -rotationSpeed * Time.deltaTime);
}
}
}