initial commit
This commit is contained in:
parent
6715289efe
commit
788c3389af
37645 changed files with 2526849 additions and 80 deletions
|
@ -0,0 +1,64 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.ResourceManagement.ResourceLocations;
|
||||
using UnityEngine.ResourceManagement.ResourceProviders;
|
||||
|
||||
namespace UnityEngine.ResourceManagement.Tests
|
||||
{
|
||||
class MockProvider : IResourceProvider, IUpdateReceiver
|
||||
{
|
||||
public string _ProviderId = "MockProvider";
|
||||
public ProviderBehaviourFlags _BehaviourFlags = ProviderBehaviourFlags.None;
|
||||
public List<KeyValuePair<IResourceLocation, object>> ReleaseLog = new List<KeyValuePair<IResourceLocation, object>>();
|
||||
public List<IResourceLocation> ProvideLog = new List<IResourceLocation>();
|
||||
|
||||
public int UpdateCount = 0;
|
||||
|
||||
public string ProviderId
|
||||
{
|
||||
get { return _ProviderId; }
|
||||
}
|
||||
|
||||
public ProviderBehaviourFlags BehaviourFlags
|
||||
{
|
||||
get { return _BehaviourFlags; }
|
||||
}
|
||||
|
||||
public Action<ProvideHandle> ProvideCallback;
|
||||
public Type DefaultType = typeof(object);
|
||||
|
||||
public Func<Type, IResourceLocation, bool> CanProvideCallback = (x, y) => true;
|
||||
|
||||
public void Update(float unscaledDeltaTime)
|
||||
{
|
||||
UpdateCount++;
|
||||
}
|
||||
|
||||
public void Release(IResourceLocation location, object asset)
|
||||
{
|
||||
ReleaseLog.Add(new KeyValuePair<IResourceLocation, object>(location, asset));
|
||||
}
|
||||
|
||||
public void Provide(ProvideHandle provideHandle)
|
||||
{
|
||||
ProvideLog.Add(provideHandle.Location);
|
||||
if (ProvideCallback != null && (ProvideCallback as Action<ProvideHandle>) != null)
|
||||
{
|
||||
ProvideCallback(provideHandle);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public Type GetDefaultType(IResourceLocation location)
|
||||
{
|
||||
return DefaultType;
|
||||
}
|
||||
|
||||
public bool CanProvide(Type t, IResourceLocation location)
|
||||
{
|
||||
return CanProvideCallback(t, location);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: df92c48909f708647b98ae363e7618d8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue