Files
Darklings-FightingGame/Assets/_Project/Scripts/UpdateTimer.cs
2022-12-14 18:33:44 +02:00

20 lines
420 B
C#

using System.Threading.Tasks;
using UnityEngine;
namespace Demonics.Utility
{
public static class UpdateTimer
{
public static async Task WaitFor(float waitTime)
{
if (waitTime <= 0f) return;
float timer = 0;
while (timer < waitTime)
{
timer += Time.deltaTime;
await Task.Yield();
}
}
}
}