21 lines
373 B
C#
21 lines
373 B
C#
|
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);
|
||
|
}
|
||
|
}
|