feat: added WaitForSeconds and WaitWhile yields
This commit is contained in:
10
Engine.Core/Systems/Yields/WaitForSecondsYield.cs
Normal file
10
Engine.Core/Systems/Yields/WaitForSecondsYield.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Engine.Core;
|
||||
|
||||
public class WaitForSecondsYield(float seconds) : ICoroutineYield
|
||||
{
|
||||
private readonly DateTime triggerTime = DateTime.UtcNow.AddSeconds(seconds);
|
||||
|
||||
public bool Yield() => DateTime.UtcNow < triggerTime;
|
||||
}
|
||||
Reference in New Issue
Block a user