Exemple #1
0
 void Awake()
 {
     instance = this;
     _poolItem.Add("Bg", Resources.Load <GameObject>(""));
     _poolItem.Add("FakeItem", Resources.Load <GameObject>(""));
     init();
 }
Exemple #2
0
 void Awake()
 {
     cachePrefab = UICachePool.Spawn(prefabName);
     if (cachePrefab != null)
     {
         cachePrefab.transform.SetParent(transform);
     }
 }
Exemple #3
0
    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);
    }
Exemple #4
0
 void OnDisable()
 {
     UICachePool.Recycle(prefabName, cachePrefab);
 }