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

22 lines
665 B
C#
Raw Normal View History

2021-11-26 11:16:25 +03:00
using System;
using DG.Tweening;
using UnityEngine;
public class UiEffectPulse : MonoBehaviour
{
[SerializeField] private float scaleSize;
[SerializeField] private float scaleTime;
[SerializeField] private float scaleDelay;
[SerializeField] private Ease easing = Ease.Linear;
private void Start()
{
Sequence seq = DOTween.Sequence();
seq.AppendInterval(scaleDelay);
seq.Append(transform.DOScale(Vector3.one * scaleSize, scaleTime / 2f)).SetEase(easing);
seq.Append(transform.DOScale(Vector3.one, scaleTime / 2f)).SetEase(easing);
seq.SetLoops(-1).SetAutoKill(false);
seq.Play();
}
}