2026-06-19 UI, UI로직

This commit is contained in:
skrwns304@gmail.com
2026-06-19 14:27:40 +09:00
parent b751a9ed66
commit b1e85a5b89
549 changed files with 18058 additions and 20 deletions

View File

@@ -0,0 +1,46 @@
using UnityEngine;
public class RotateUI : MonoBehaviour
{
[Header("Rotation Settings")]
[SerializeField] private float rotateSpeed = 30f;
[SerializeField] private bool clockwise = true;
[SerializeField] private bool playOnStart = true;
private bool isRotating;
private void Awake()
{
isRotating = playOnStart;
}
private void Update()
{
if (!isRotating)
return;
float dir = clockwise ? -1f : 1f;
transform.Rotate(0f, 0f, dir * rotateSpeed * Time.deltaTime, Space.Self);
}
public void StartRotate()
{
isRotating = true;
}
public void StopRotate()
{
isRotating = false;
}
public void SetClockwise(bool value)
{
clockwise = value;
}
public void ResetRotation()
{
transform.localEulerAngles = Vector3.zero;
}
}