hellbound/Assets/Scripts/Game/UI/Effects/UiEffectRotate.cs

20 lines
557 B
C#

using System;
using DG.Tweening;
using UnityEngine;
public class UiEffectRotate : MonoBehaviour
{
[SerializeField] private float loopTime;
[SerializeField] private float loopDelay;
[SerializeField] private Ease easing = Ease.Linear;
private void Start()
{
Sequence seq = DOTween.Sequence();
seq.AppendInterval(loopDelay);
seq.Append(transform.DOLocalRotate(Vector3.forward * 360, loopTime, RotateMode.FastBeyond360)).SetEase(easing);
seq.SetLoops(-1).SetAutoKill(false);
seq.Play();
}
}