update runtime logic

补丁清单的资源包列表增加引用链
This commit is contained in:
hevinci
2023-02-22 15:41:01 +08:00
parent 26ffb829d0
commit fdf27cbc1a
11 changed files with 59 additions and 1 deletions
@@ -143,6 +143,7 @@ namespace YooAsset
patchBundle.IsRawFile = _buffer.ReadBool();
patchBundle.LoadMethod = _buffer.ReadByte();
patchBundle.Tags = _buffer.ReadUTF8Array();
patchBundle.ReferenceIDs = _buffer.ReadInt32Array();
Manifest.BundleList.Add(patchBundle);
patchBundle.ParseBundle(Manifest.PackageName, Manifest.OutputNameStyle);
@@ -41,7 +41,12 @@ namespace YooAsset
/// </summary>
public string[] Tags;
/// <summary>
/// 引用该资源包的ID列表
/// </summary>
public int[] ReferenceIDs;
/// <summary>
/// 所属的包裹名称
/// </summary>
@@ -220,6 +220,22 @@ namespace YooAsset
}
}
/// <summary>
/// 获取资源包名称
/// </summary>
public string GetBundleName(int bundleID)
{
if (bundleID >= 0 && bundleID < BundleList.Count)
{
var patchBundle = BundleList[bundleID];
return patchBundle.BundleName;
}
else
{
throw new Exception($"Invalid bundle id : {bundleID}");
}
}
/// <summary>
/// 尝试获取补丁资源
/// </summary>
@@ -65,6 +65,7 @@ namespace YooAsset
buffer.WriteBool(patchBundle.IsRawFile);
buffer.WriteByte(patchBundle.LoadMethod);
buffer.WriteUTF8Array(patchBundle.Tags);
buffer.WriteInt32Array(patchBundle.ReferenceIDs);
}
// 写入文件流
@@ -127,6 +128,7 @@ namespace YooAsset
patchBundle.IsRawFile = buffer.ReadBool();
patchBundle.LoadMethod = buffer.ReadByte();
patchBundle.Tags = buffer.ReadUTF8Array();
patchBundle.ReferenceIDs = buffer.ReadInt32Array();
manifest.BundleList.Add(patchBundle);
}
}
@@ -95,6 +95,10 @@ namespace YooAsset
{
throw new NotImplementedException();
}
string IBundleServices.GetBundleName(int bundleID)
{
throw new NotImplementedException();
}
bool IBundleServices.IsServicesValid()
{
return _activeManifest != null;
@@ -330,6 +330,10 @@ namespace YooAsset
}
return result.ToArray();
}
string IBundleServices.GetBundleName(int bundleID)
{
return _activeManifest.GetBundleName(bundleID);
}
bool IBundleServices.IsServicesValid()
{
return _activeManifest != null;
@@ -123,6 +123,10 @@ namespace YooAsset
}
return result.ToArray();
}
string IBundleServices.GetBundleName(int bundleID)
{
return _activeManifest.GetBundleName(bundleID);
}
bool IBundleServices.IsServicesValid()
{
return _activeManifest != null;