hellbound/Assets/Scripts/Core/Utils/Tween.cs

21 lines
373 B
C#
Raw Permalink Normal View History

2021-11-26 11:16:25 +03:00
using System;
using System.Collections;
using UnityEngine;
public static class Tween
{
public static IEnumerator DoTween(float time, Action<float> update)
{
float timer = 0f;
while (timer < time)
{
update(timer / time);
timer += Time.deltaTime;
yield return null;
}
update(1f);
}
}