using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace MPStudio
{
    public class AutoRotate : MonoBehaviour
    {
        public int dir = 1;
        
        [SerializeField] private float rotationSpeed = 30f; // 旋转速度（度/秒）
        [SerializeField] private Vector3 rotationAxis = Vector3.forward; // 旋转轴（默认Z轴，2D适用）

        void Update()
        {
            // 每帧绕指定轴旋转
            transform.Rotate(rotationAxis * rotationSpeed * Time.deltaTime*dir,Space.Self);
        }
    }
}