using System.Collections;
namespace X10D.Unity;
///
/// Represents a yield instruction that waits for a specific number of frames.
///
public struct WaitForFrames : IEnumerator
{
private readonly int _frameCount;
private int _frameIndex;
///
/// Initializes a new instance of the struct.
///
/// The frame count.
public WaitForFrames(int frameCount)
{
_frameCount = frameCount;
_frameIndex = 0;
}
///
public object Current
{
get => _frameCount;
}
///
public bool MoveNext()
{
return ++_frameIndex <= _frameCount;
}
///
public void Reset()
{
_frameIndex = 0;
}
}