示例#1
0
 public AssetObject GetCached(string path)
 {
     Tangzx.ABSystem.ObjectPool <AssetObject> aPool = null;
     if (_cachedAssetObj.TryGetValue(path, out aPool))
     {
         if (aPool.countInactive > 0)
         {
             AssetObject ao = aPool.Get();
             ao.CachedTransform.SetParent(null);
             return(ao);
         }
     }
     return(null);
 }
示例#2
0
 public void Unload(AssetObject assetObj)
 {
     if (assetObj == null)
     {
         Debug.LogError("Unknow Destroy!");
         return;
     }
     Tangzx.ABSystem.ObjectPool <AssetObject> aPool = null;
     if (!_cachedAssetObj.TryGetValue(assetObj.key, out aPool))
     {
         aPool = new Tangzx.ABSystem.ObjectPool <AssetObject>(null, null);
     }
     if (aPool.countInactive > 5)
     {
         GameObject.DestroyImmediate(assetObj.gameObject);
     }
     else
     {
         assetObj.CachedTransform.SetParent(_cachedParent);
         aPool.Release(assetObj);
     }
 }