Update
This commit is contained in:
ALEXTANG
2022-05-27 16:52:29 +08:00
parent 64a11568a2
commit 8f594099dd
4 changed files with 19 additions and 11 deletions

View File

@@ -9,8 +9,8 @@ namespace TEngine
[Serializable]
public struct VersonConfig
{
public string AppVersion; //底包版本号
public string BaseResVersion; //基于底包对应的资源版本号
public string AppVersion; //APP版本号
public string BaseResVersion; //APP对应的资源版本号
public string ResVersion; //资源版本号
}

View File

@@ -30,7 +30,7 @@ namespace TEngine
readonly Dictionary<string, string> _assetPath2BundleDatas = new Dictionary<string, string>();
/// <summary>
/// 加载资源依赖数据产生AssetBundle依赖拓扑
/// 加载资源依赖
/// </summary>
public void Load()
{
@@ -52,10 +52,10 @@ namespace TEngine
bundleName = reader.ReadString();
assetCount = reader.ReadInt32();
assetPaths = new string[assetCount];
for (int ii = 0; ii < assetCount; ++ii)
for (int j = 0; j < assetCount; ++j)
{
assetPaths[ii] = reader.ReadString();
_assetPath2BundleDatas.Add(assetPaths[ii], bundleName);
assetPaths[j] = reader.ReadString();
_assetPath2BundleDatas.Add(assetPaths[j], bundleName);
}
depCount = reader.ReadInt32();
if (!_bundleDatas.TryGetValue(bundleName, out assetBundleData))
@@ -72,7 +72,7 @@ namespace TEngine
assetBundleData.InitAssets(assetPaths);
for (int ii = 0; ii < depCount; ++ii)
for (int j = 0; j < depCount; ++j)
{
bundleName = reader.ReadString();
if (!_bundleDatas.TryGetValue(bundleName, out depAssetBundleData))
@@ -80,21 +80,20 @@ namespace TEngine
depAssetBundleData = new AssetBundleData(bundleName);
_bundleDatas.Add(bundleName, depAssetBundleData);
}
assetBundleData.Dependencies[ii] = depAssetBundleData;
assetBundleData.Dependencies[j] = depAssetBundleData;
}
}
stream.Close();
#endif
}
/// <summary>
/// 卸载AssetBundle数据
/// </summary>
public void Unload()
{
#if ASSETBUNDLE_ENABLE
foreach(var bundleData in _bundleDatas)
{
bundleData.Value.Unload(true);
}
_bundleDatas.Clear();
_assetPath2BundleDatas.Clear();
#endif
@@ -104,7 +103,9 @@ namespace TEngine
{
#if ASSETBUNDLE_ENABLE
foreach(var bundleData in _bundleDatas)
{
bundleData.Value.UnloadBundleFalse();
}
_bundleDatas.Clear();
_assetPath2BundleDatas.Clear();
#endif