Ver.0.3.0.33

This commit is contained in:
2025-07-08 08:32:46 +00:00
parent 99f4dd67c2
commit 0ad5e29917
6831 changed files with 695623 additions and 234455 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);
}
}
}