|
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);
|
|
}
|
|
} |