Since you do not answer, I assume you said "you cannot use it" for no reason which is very strange. I was able to use it fine. In fact, looking at the documentation, it does list the parameters in the constructor under the single-parameter constructor (although it lists the wrong parameter type for onTimeout, in reality it is System.Action not whatever that is).
using System;
using System.Collections;
using UnityEngine;
public class TestYield : MonoBehaviour
{
public float waitTimeInSeconds = 1.5f;
public int timeoutSeconds = 3;
private double _startTime;
protected IEnumerator Start()
{
_startTime = Time.realtimeSinceStartupAsDouble;
Debug.Log($"Start: {gameObject.name}");
yield return new WaitUntil(WaitTime, new TimeSpan(0, 0, 0, timeoutSeconds), LogTimeout);
Debug.Log($"End: {gameObject.name}");
}
protected void LogTimeout()
{
Debug.Log($"Timeout: {gameObject.name}");
}
protected bool WaitTime()
{
while (Time.realtimeSinceStartupAsDouble - _startTime < waitTimeInSeconds)
{
return false;
}
return true;
}
}
Seriously, why just say random things?