mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Init TEngine4.0.0
Init TEngine4.0.0
This commit is contained in:
47
UnityProject/Packages/UniTask/Runtime/Linq/Empty.cs
Normal file
47
UnityProject/Packages/UniTask/Runtime/Linq/Empty.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using System.Threading;
|
||||
|
||||
namespace Cysharp.Threading.Tasks.Linq
|
||||
{
|
||||
public static partial class UniTaskAsyncEnumerable
|
||||
{
|
||||
public static IUniTaskAsyncEnumerable<T> Empty<T>()
|
||||
{
|
||||
return Cysharp.Threading.Tasks.Linq.Empty<T>.Instance;
|
||||
}
|
||||
}
|
||||
|
||||
internal class Empty<T> : IUniTaskAsyncEnumerable<T>
|
||||
{
|
||||
public static readonly IUniTaskAsyncEnumerable<T> Instance = new Empty<T>();
|
||||
|
||||
Empty()
|
||||
{
|
||||
}
|
||||
|
||||
public IUniTaskAsyncEnumerator<T> GetAsyncEnumerator(CancellationToken cancellationToken = default)
|
||||
{
|
||||
return _Empty.Instance;
|
||||
}
|
||||
|
||||
class _Empty : IUniTaskAsyncEnumerator<T>
|
||||
{
|
||||
public static readonly IUniTaskAsyncEnumerator<T> Instance = new _Empty();
|
||||
|
||||
_Empty()
|
||||
{
|
||||
}
|
||||
|
||||
public T Current => default;
|
||||
|
||||
public UniTask<bool> MoveNextAsync()
|
||||
{
|
||||
return CompletedTasks.False;
|
||||
}
|
||||
|
||||
public UniTask DisposeAsync()
|
||||
{
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user