mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Update
Update
This commit is contained in:
@@ -9,8 +9,8 @@ namespace TEngine
|
|||||||
[Serializable]
|
[Serializable]
|
||||||
public struct VersonConfig
|
public struct VersonConfig
|
||||||
{
|
{
|
||||||
public string AppVersion; //底包版本号
|
public string AppVersion; //APP版本号
|
||||||
public string BaseResVersion; //基于底包对应的资源版本号
|
public string BaseResVersion; //APP对应的资源版本号
|
||||||
public string ResVersion; //资源版本号
|
public string ResVersion; //资源版本号
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,7 +30,7 @@ namespace TEngine
|
|||||||
readonly Dictionary<string, string> _assetPath2BundleDatas = new Dictionary<string, string>();
|
readonly Dictionary<string, string> _assetPath2BundleDatas = new Dictionary<string, string>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载资源依赖数据,产生AssetBundle依赖拓扑
|
/// 加载资源依赖
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void Load()
|
public void Load()
|
||||||
{
|
{
|
||||||
@@ -52,10 +52,10 @@ namespace TEngine
|
|||||||
bundleName = reader.ReadString();
|
bundleName = reader.ReadString();
|
||||||
assetCount = reader.ReadInt32();
|
assetCount = reader.ReadInt32();
|
||||||
assetPaths = new string[assetCount];
|
assetPaths = new string[assetCount];
|
||||||
for (int ii = 0; ii < assetCount; ++ii)
|
for (int j = 0; j < assetCount; ++j)
|
||||||
{
|
{
|
||||||
assetPaths[ii] = reader.ReadString();
|
assetPaths[j] = reader.ReadString();
|
||||||
_assetPath2BundleDatas.Add(assetPaths[ii], bundleName);
|
_assetPath2BundleDatas.Add(assetPaths[j], bundleName);
|
||||||
}
|
}
|
||||||
depCount = reader.ReadInt32();
|
depCount = reader.ReadInt32();
|
||||||
if (!_bundleDatas.TryGetValue(bundleName, out assetBundleData))
|
if (!_bundleDatas.TryGetValue(bundleName, out assetBundleData))
|
||||||
@@ -72,7 +72,7 @@ namespace TEngine
|
|||||||
|
|
||||||
assetBundleData.InitAssets(assetPaths);
|
assetBundleData.InitAssets(assetPaths);
|
||||||
|
|
||||||
for (int ii = 0; ii < depCount; ++ii)
|
for (int j = 0; j < depCount; ++j)
|
||||||
{
|
{
|
||||||
bundleName = reader.ReadString();
|
bundleName = reader.ReadString();
|
||||||
if (!_bundleDatas.TryGetValue(bundleName, out depAssetBundleData))
|
if (!_bundleDatas.TryGetValue(bundleName, out depAssetBundleData))
|
||||||
@@ -80,21 +80,20 @@ namespace TEngine
|
|||||||
depAssetBundleData = new AssetBundleData(bundleName);
|
depAssetBundleData = new AssetBundleData(bundleName);
|
||||||
_bundleDatas.Add(bundleName, depAssetBundleData);
|
_bundleDatas.Add(bundleName, depAssetBundleData);
|
||||||
}
|
}
|
||||||
assetBundleData.Dependencies[ii] = depAssetBundleData;
|
assetBundleData.Dependencies[j] = depAssetBundleData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stream.Close();
|
stream.Close();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 卸载AssetBundle数据
|
|
||||||
/// </summary>
|
|
||||||
public void Unload()
|
public void Unload()
|
||||||
{
|
{
|
||||||
#if ASSETBUNDLE_ENABLE
|
#if ASSETBUNDLE_ENABLE
|
||||||
foreach(var bundleData in _bundleDatas)
|
foreach(var bundleData in _bundleDatas)
|
||||||
|
{
|
||||||
bundleData.Value.Unload(true);
|
bundleData.Value.Unload(true);
|
||||||
|
}
|
||||||
_bundleDatas.Clear();
|
_bundleDatas.Clear();
|
||||||
_assetPath2BundleDatas.Clear();
|
_assetPath2BundleDatas.Clear();
|
||||||
#endif
|
#endif
|
||||||
@@ -104,7 +103,9 @@ namespace TEngine
|
|||||||
{
|
{
|
||||||
#if ASSETBUNDLE_ENABLE
|
#if ASSETBUNDLE_ENABLE
|
||||||
foreach(var bundleData in _bundleDatas)
|
foreach(var bundleData in _bundleDatas)
|
||||||
|
{
|
||||||
bundleData.Value.UnloadBundleFalse();
|
bundleData.Value.UnloadBundleFalse();
|
||||||
|
}
|
||||||
_bundleDatas.Clear();
|
_bundleDatas.Clear();
|
||||||
_assetPath2BundleDatas.Clear();
|
_assetPath2BundleDatas.Clear();
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"com.unity.2d.sprite": "1.0.0",
|
||||||
"com.unity.collab-proxy": "1.2.16",
|
"com.unity.collab-proxy": "1.2.16",
|
||||||
"com.unity.ide.rider": "1.1.4",
|
"com.unity.ide.rider": "1.1.4",
|
||||||
"com.unity.ide.vscode": "1.2.1",
|
"com.unity.ide.vscode": "1.2.1",
|
||||||
|
@@ -1,5 +1,11 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"com.unity.2d.sprite": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "builtin",
|
||||||
|
"dependencies": {}
|
||||||
|
},
|
||||||
"com.unity.collab-proxy": {
|
"com.unity.collab-proxy": {
|
||||||
"version": "1.2.16",
|
"version": "1.2.16",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
|
Reference in New Issue
Block a user