This commit is contained in:
SoulliesOfficial
2025-12-17 04:19:38 -05:00
parent 7c1cb7e8e1
commit d15957c719
4315 changed files with 8260710 additions and 2940 deletions

View File

@@ -0,0 +1,38 @@
using UnityEngine;
namespace GraphicsCat
{
public class AutoRotate : MonoBehaviour, IMGUIDockable
{
public bool autoRotateEnabled = true;
public Vector3 autoRotateSpeed = new Vector3(0, 5, 0);
public bool guiEnabled = false;
Transform m_Transform;
void Start()
{
m_Transform = transform;
if (guiEnabled)
IMGUIDock.topRight.DockGUI(this);
}
void Update()
{
if (autoRotateEnabled)
{
m_Transform.Rotate(autoRotateSpeed * Time.deltaTime, Space.Self);
// m_Transform.localEulerAngles = m_Transform.localEulerAngles + autoRotateSpeed * Time.deltaTime;
}
}
public void OnDockGUI()
{
GUILayout.BeginHorizontal();
if (GUILayout.Button($"Auto Rotate {(autoRotateEnabled ? "O" : "X")}"))
autoRotateEnabled = !autoRotateEnabled;
GUILayout.EndHorizontal();
}
}
}