Exemple #1
0
 public bool TryGetAssetSync(int hashCode, out VFSAsset asset)
 {
     lock (this)
     {
         if (mDict_Assets_KeyHashCode_Sync.TryGetValue(hashCode, out asset))
         {
             if (asset.LoadState == AssetLoadState.Unloaded)
             {
                 mAssets_Sync.Remove(asset);
                 mDict_Assets_KeyHashCode_Sync.Remove(hashCode);
                 mDict_Assets_KeyName_Sync.Remove(asset.AssetPathLower);
                 asset = null;
                 return(false);
             }
             else
             {
                 return(true);
             }
         }
         else
         {
             return(false);
         }
     }
 }
Exemple #2
0
 public bool TryGetAsset(string path, out VFSAsset asset)
 {
     lock (this)
     {
         if (mDict_Assets_KeyName.TryGetValue(path, out asset))
         {
             if (asset.LoadState == AssetLoadState.Unloaded)
             {
                 mAssets.Remove(asset);
                 mDict_Assets_KeyHashCode.Remove(asset.GetHashCode());
                 mDict_Assets_KeyName.Remove(asset.AssetPathLower);
                 asset = null;
                 return(false);
             }
             else
             {
                 return(true);
             }
         }
         else
         {
             return(false);
         }
     }
 }
Exemple #3
0
 internal protected void UnRegisterAsset(VFSAsset asset)
 {
     if (this.Assets.Contains(asset))
     {
         this.Assets.Remove(asset);
     }
 }
Exemple #4
0
 /// <summary>
 /// 当某个asset有此bundle成功load之后,将其注册进来
 /// </summary>
 /// <param name="asset"></param>
 internal protected void RegisterAsset(VFSAsset asset)
 {
     if (!this.Assets.Contains(asset))
     {
         this.Assets.Add(asset);
     }
 }
Exemple #5
0
        public void RegisterHashCodeSync(VFSAsset asset)
        {
            if (asset == null || asset.Asset == null)
            {
                return;
            }

            int hashCode = asset.Asset.GetHashCode();

            if (!mDict_Assets_KeyHashCode_Sync.ContainsKey(hashCode))
            {
                mDict_Assets_KeyHashCode_Sync.Add(hashCode, asset);
            }
        }
Exemple #6
0
        public void RegisterSync(VFSAsset asset)
        {
            if (!mAssets_Sync.Contains(asset))
            {
                mAssets_Sync.Add(asset);
            }

            if (mDict_Assets_KeyName_Sync.ContainsKey(asset.AssetPathLower))
            {
                mDict_Assets_KeyName_Sync[asset.AssetPathLower] = asset;
            }
            else
            {
                mDict_Assets_KeyName_Sync.Add(asset.AssetPathLower, asset);
            }
        }
Exemple #7
0
        public void Register(VFSAsset asset)
        {
            lock (this)
            {
                if (!mAssets.Contains(asset))
                {
                    mAssets.Add(asset);
                }

                if (mDict_Assets_KeyName.ContainsKey(asset.AssetPathLower))
                {
                    mDict_Assets_KeyName[asset.AssetPathLower] = asset;
                }
                else
                {
                    mDict_Assets_KeyName.Add(asset.AssetPathLower, asset);
                }
            }
        }