25 lines
668 B
C#
25 lines
668 B
C#
|
|
using System.Buffers;
|
||
|
|
using AlicizaX.ObjectPool;
|
||
|
|
using AlicizaX.Runtime;
|
||
|
|
|
||
|
|
namespace AlicizaX.Resource.Runtime
|
||
|
|
{
|
||
|
|
public class AssetItemObject : ObjectBase
|
||
|
|
{
|
||
|
|
public static AssetItemObject Create(string location, UnityEngine.Object target)
|
||
|
|
{
|
||
|
|
AssetItemObject item = ReferencePool.Acquire<AssetItemObject>();
|
||
|
|
item.Initialize(location, target);
|
||
|
|
return item;
|
||
|
|
}
|
||
|
|
|
||
|
|
protected override void Release(bool isShutdown)
|
||
|
|
{
|
||
|
|
if (Target == null)
|
||
|
|
{
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
GameEntry.GetComponent<ResourceComponent>().UnloadAsset(Target);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|