void Awake() { instance = this; _poolItem.Add("Bg", Resources.Load <GameObject>("")); _poolItem.Add("FakeItem", Resources.Load <GameObject>("")); init(); }
void Awake() { cachePrefab = UICachePool.Spawn(prefabName); if (cachePrefab != null) { cachePrefab.transform.SetParent(transform); } }
public static BasePool create(string resName, string resPath, E_PoolMode mode, E_PoolType pType, float time) { BasePool p = null; switch (pType) { case E_PoolType.UICache: p = new UICachePool(resName, resPath, mode, pType, time); break; case E_PoolType.Atlas: p = new AtlasPool(resName, resPath, mode, pType, time); break; case E_PoolType.Model: p = new ModelPool(resName, resPath, mode, pType, time); break; default: p = new BasePool(resName, resPath, mode, pType, time); break; } return(p); }
void OnDisable() { UICachePool.Recycle(prefabName, cachePrefab); }