Skip to content

Commit

Permalink
[change]:移除资源清单的游戏版本号字段
Browse files Browse the repository at this point in the history
  • Loading branch information
CatImmortal committed Mar 27, 2023
1 parent 6f66baf commit ca4a837
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
8 changes: 3 additions & 5 deletions Assets/CatAsset/Editor/BuildPipeline/Task/BuildManifest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,16 @@ public ReturnCode Run()
//创建资源清单
CatAssetManifest manifest = new CatAssetManifest
{
GameVersion = Application.version,
ManifestVersion = configParam.Config.ManifestVersion,
Platform = configParam.TargetPlatform.ToString(),
Bundles = new List<BundleManifestInfo>(),
};

//增加内置Shader资源包的构建信息
string builtInShadersBundleName = "UnityBuiltInShaders.bundle";
if (results.BundleInfos.ContainsKey(builtInShadersBundleName))
if (results.BundleInfos.ContainsKey(RuntimeUtil.BuiltInShaderBundleName))
{
BundleBuildInfo bundleBuildInfo =
new BundleBuildInfo(string.Empty, builtInShadersBundleName, GroupInfo.DefaultGroup, false,
new BundleBuildInfo(string.Empty, RuntimeUtil.BuiltInShaderBundleName, GroupInfo.DefaultGroup, false,
configParam.Config.GlobalCompress,configParam.Config.GlobalEncrypt);
infoParam.NormalBundleBuilds.Add(bundleBuildInfo);
}
Expand All @@ -98,7 +96,7 @@ public ReturnCode Run()
bundleManifestInfo.IsScene = bundleBuildInfo.Assets[0].Name.EndsWith(".unity");
}
BundleDetails details = results.BundleInfos[bundleManifestInfo.BundleIdentifyName];
if (details.Dependencies.Contains(builtInShadersBundleName))
if (details.Dependencies.Contains(RuntimeUtil.BuiltInShaderBundleName))
{
//依赖内置Shader资源包
bundleManifestInfo.IsDependencyBuiltInShaderBundle = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ public class CatAssetManifest
/// <summary>
/// 序列化版本
/// </summary>
public const int SerializeVersion = 0;

/// <summary>
/// 游戏版本号
/// </summary>
public string GameVersion;
private const int serializeVersion = 0;

/// <summary>
/// 清单版本号
Expand Down Expand Up @@ -77,8 +72,7 @@ public byte[] SerializeToBinary()
{
using (BinaryWriter writer = new BinaryWriter(ms,Encoding.UTF8))
{
writer.Write(SerializeVersion);
writer.Write(GameVersion);
writer.Write(serializeVersion);
writer.Write(ManifestVersion);
writer.Write(Platform);

Expand Down Expand Up @@ -109,7 +103,6 @@ public static CatAssetManifest DeserializeFromBinary(byte[] bytes)
CatAssetManifest manifest = new CatAssetManifest();

int serializeVersion = reader.ReadInt32();
manifest.GameVersion = reader.ReadString();
manifest.ManifestVersion = reader.ReadInt32();
manifest.Platform = reader.ReadString();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,15 +340,15 @@ protected virtual void LoadDone()
/// </summary>
private void CallFinished(bool success)
{
if (!success)
{
Debug.LogError($"资源包加载失败:{BundleRuntimeInfo.Manifest}");
}

foreach (LoadBundleTask task in MergedTasks)
{
if (!task.IsCanceled)
{
if (!success)
{
Debug.LogError($"资源包加载失败:{BundleRuntimeInfo.Manifest}");
}

task.OnFinishedCallback?.Invoke(success);
}
}
Expand Down
1 change: 0 additions & 1 deletion Assets/CatAsset/Runtime/Updatable/CatAssetUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ internal static void GenerateReadWriteManifest()
//创建 CatAssetManifest
CatAssetManifest manifest = new CatAssetManifest
{
GameVersion = Application.version,
Platform = Application.platform.ToString()
};

Expand Down

0 comments on commit ca4a837

Please sign in to comment.