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

21 lines
373 B
C#
Raw Permalink Normal View History

2021-12-29 20:50:11 +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);
}
}