revival/game/Assets/Scripts/Animation/Spin.cs

25 lines
563 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using Ktyl.Util;
using TMPro;
using UnityEngine;
public class Spin : MonoBehaviour
{
[SerializeField] private float _speed;
[SerializeField] private SerialFloat _objectTimeScale;
void LateUpdate()
{
float timeScale = 1.0f;
if (_objectTimeScale != null)
{
timeScale = _objectTimeScale;
}
var dt = Time.deltaTime * timeScale;
transform.Rotate(new Vector3(0,dt*_speed,0));
}
}