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

25 lines
563 B
C#
Raw Normal View History

2021-05-10 22:27:55 +02:00
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));
}
}