geometry-tower-defense-base/src-ref/PoolObjectBase/RepoItemObject.cs

29 lines
677 B
C#

using GameFramework;
using GameFramework.ObjectPool;
using GeometryTD.UI;
using UnityEngine;
namespace GeometryTD.PoolObjectBase
{
public class RepoItemObject : ObjectBase
{
public static RepoItemObject Create(object target)
{
RepoItemObject itemObject = ReferencePool.Acquire<RepoItemObject>();
itemObject.Initialize(target);
return itemObject;
}
protected override void Release(bool isShutdown)
{
RepoItem item = (RepoItem)Target;
if (item == null)
{
return;
}
Object.Destroy(item.gameObject);
}
}
}