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); } } }
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); } } }
internal protected void UnRegisterAsset(VFSAsset asset) { if (this.Assets.Contains(asset)) { this.Assets.Remove(asset); } }
/// <summary> /// 当某个asset有此bundle成功load之后,将其注册进来 /// </summary> /// <param name="asset"></param> internal protected void RegisterAsset(VFSAsset asset) { if (!this.Assets.Contains(asset)) { this.Assets.Add(asset); } }
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); } }
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); } }
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); } } }