//--------------------------------------------------------
|
// [Author]: 第二世界
|
// [ Date ]: Tuesday, November 21, 2017
|
//--------------------------------------------------------
|
using UnityEngine;
|
using System.Collections;
|
using UnityEngine.UI;
|
|
namespace vnxbqy.UI {
|
|
public class HeadUpSkillNamePool:MonoBehaviour {
|
|
static GameObjectPoolManager.GameObjectPool pool = null;
|
|
public static HeadUpSkillName Require()
|
{
|
if (pool == null)
|
{
|
var prefab = UILoader.LoadPrefab("HeadUpSkillName");
|
if (prefab != null)
|
{
|
pool = GameObjectPoolManager.Instance.RequestPool(prefab);
|
}
|
}
|
|
if (pool != null)
|
{
|
var instance = pool.Request();
|
return instance.GetComponent<HeadUpSkillName>();
|
}
|
else
|
{
|
return null;
|
}
|
}
|
|
public static void Recycle(GameObject _gameObject)
|
{
|
if (pool != null)
|
{
|
pool.Release(_gameObject);
|
_gameObject.transform.SetParent(null);
|
_gameObject.SetActive(false);
|
}
|
}
|
|
public static void Clear()
|
{
|
if (pool != null)
|
{
|
pool.Clear();
|
pool = null;
|
}
|
}
|
|
}
|
|
}
|