新增 FlowScope Git 包雏形
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using FlowScope.Addressables;
|
||||
|
||||
namespace FlowScope.Resources
|
||||
{
|
||||
public sealed class AddressablesResourceService : IResourceService, ICompletedResourceService
|
||||
{
|
||||
private readonly ResourceService _inner;
|
||||
|
||||
public AddressablesResourceService()
|
||||
: this(new AddressablesResourceBackend())
|
||||
{
|
||||
}
|
||||
|
||||
public AddressablesResourceService(IResourceBackend backend)
|
||||
{
|
||||
_inner = new ResourceService(backend);
|
||||
}
|
||||
|
||||
public Task<IResourceHandle<T>> LoadAsync<T>(string key, CancellationToken cancellationToken)
|
||||
where T : class
|
||||
{
|
||||
return _inner.LoadAsync<T>(key, cancellationToken);
|
||||
}
|
||||
|
||||
public IResourceGroup CreateGroup()
|
||||
{
|
||||
return _inner.CreateGroup();
|
||||
}
|
||||
|
||||
public bool TryLoadCompleted<T>(string key, out IResourceHandle<T> handle)
|
||||
where T : class
|
||||
{
|
||||
return _inner.TryLoadCompleted(key, out handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user