Initial commit

This commit is contained in:
2026-06-02 18:57:47 -04:00
commit 59d26a915d
268 changed files with 41240 additions and 0 deletions
@@ -0,0 +1,31 @@
using System;
using UnityEngine;
using UnityEngine.TestTools;
namespace BracerLib.Utility.Coroutines
{
[ExcludeFromCoverage]
public class CancellableWaitForSeconds : CustomYieldInstruction
{
private float remaining;
private readonly Func<bool> predicate;
public override bool keepWaiting => ShouldKeepWaiting();
public CancellableWaitForSeconds(float wait, Func<bool> predicate)
{
remaining = wait;
this.predicate = predicate;
}
private bool ShouldKeepWaiting()
{
remaining -= Time.deltaTime;
var check = CheckCustomPredicate();
return !(check || remaining < 0f);
}
private bool CheckCustomPredicate() => predicate?.Invoke() ?? false;
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: c1f806820d3cd904399807656f490d62