using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using vnxbqy.UI;
|
public class HeadUpTreasurePool
|
{
|
static GameObjectPoolManager.GameObjectPool pool;
|
|
public static HeadUpTreasure Require()
|
{
|
var prefab = UILoader.LoadPrefab("HeadUp_Treasure");
|
pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
if (pool != null)
|
{
|
var instance = pool.Request();
|
var headUpName = instance.GetComponent<HeadUpTreasure>();
|
headUpName.enabled = true;
|
return headUpName;
|
}
|
else
|
{
|
return null;
|
}
|
}
|
|
public static void Recycle(HeadUpTreasure _headUpName)
|
{
|
if (pool != null)
|
{
|
_headUpName.enabled = false;
|
pool.Release(_headUpName.gameObject);
|
}
|
}
|
|
public static void Clear()
|
{
|
pool.Clear();
|
}
|
|
}
|