From d158e864b556b5970709c2a52e47944d53aa98a2 Mon Sep 17 00:00:00 2001 From: Perfare Date: Thu, 16 Jun 2022 18:41:55 +0800 Subject: [PATCH] support 2022.1 --- AssetStudio/Classes/AnimationClip.cs | 5 +++++ AssetStudio/Classes/Mesh.cs | 5 +++++ AssetStudio/Classes/Shader.cs | 12 +++++++++++- README.md | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/AssetStudio/Classes/AnimationClip.cs b/AssetStudio/Classes/AnimationClip.cs index 95a381a5..5769838d 100644 --- a/AssetStudio/Classes/AnimationClip.cs +++ b/AssetStudio/Classes/AnimationClip.cs @@ -797,6 +797,7 @@ public class GenericBinding public ClassIDType typeID; public byte customType; public byte isPPtrCurve; + public byte isIntCurve; public GenericBinding() { } @@ -816,6 +817,10 @@ public GenericBinding(ObjectReader reader) } customType = reader.ReadByte(); isPPtrCurve = reader.ReadByte(); + if (version[0] > 2022 || (version[0] == 2022 && version[1] >= 1)) //2022.1 and up + { + isIntCurve = reader.ReadByte(); + } reader.AlignStream(); } } diff --git a/AssetStudio/Classes/Mesh.cs b/AssetStudio/Classes/Mesh.cs index c936d143..e11c637c 100644 --- a/AssetStudio/Classes/Mesh.cs +++ b/AssetStudio/Classes/Mesh.cs @@ -651,6 +651,11 @@ public Mesh(ObjectReader reader) : base(reader) int m_MeshUsageFlags = reader.ReadInt32(); + if (version[0] > 2022 || (version[0] == 2022 && version[1] >= 1)) //2022.1 and up + { + int m_CookingOptions = reader.ReadInt32(); + } + if (version[0] >= 5) //5.0 and up { var m_BakedConvexCollisionMesh = reader.ReadUInt8Array(); diff --git a/AssetStudio/Classes/Shader.cs b/AssetStudio/Classes/Shader.cs index 0d80c5ad..e0fbc415 100644 --- a/AssetStudio/Classes/Shader.cs +++ b/AssetStudio/Classes/Shader.cs @@ -428,6 +428,7 @@ public ConstantBuffer(ObjectReader reader) if ((version[0] == 2020 && version[1] > 3) || (version[0] == 2020 && version[1] == 3 && version[2] >= 2) || //2020.3.2f1 and up + (version[0] > 2021) || (version[0] == 2021 && version[1] > 1) || (version[0] == 2021 && version[1] == 1 && version[2] >= 4)) //2021.1.4f1 and up { @@ -605,6 +606,7 @@ public SerializedSubProgram(ObjectReader reader) if ((version[0] == 2020 && version[1] > 3) || (version[0] == 2020 && version[1] == 3 && version[2] >= 2) || //2020.3.2f1 and up + (version[0] > 2021) || (version[0] == 2021 && version[1] > 1) || (version[0] == 2021 && version[1] == 1 && version[2] >= 1)) //2021.1.1f1 and up { @@ -690,6 +692,7 @@ public class SerializedProgram { public SerializedSubProgram[] m_SubPrograms; public SerializedProgramParameters m_CommonParameters; + public ushort[] m_SerializedKeywordStateMask; public SerializedProgram(ObjectReader reader) { @@ -704,11 +707,18 @@ public SerializedProgram(ObjectReader reader) if ((version[0] == 2020 && version[1] > 3) || (version[0] == 2020 && version[1] == 3 && version[2] >= 2) || //2020.3.2f1 and up + (version[0] > 2021) || (version[0] == 2021 && version[1] > 1) || (version[0] == 2021 && version[1] == 1 && version[2] >= 1)) //2021.1.1f1 and up { m_CommonParameters = new SerializedProgramParameters(reader); } + + if (version[0] > 2022 || (version[0] == 2022 && version[1] >= 1)) //2022.1 and up + { + m_SerializedKeywordStateMask = reader.ReadUInt16Array(); + reader.AlignStream(); + } } } @@ -795,7 +805,7 @@ public SerializedPass(ObjectReader reader) m_Name = reader.ReadAlignedString(); m_TextureName = reader.ReadAlignedString(); m_Tags = new SerializedTagMap(reader); - if (version[0] > 2021 || (version[0] == 2021 && version[1] >= 2)) //2021.2 and up + if (version[0] == 2021 && version[1] >= 2) //2021.2 ~2021.x { m_SerializedKeywordStateMask = reader.ReadUInt16Array(); reader.AlignStream(); diff --git a/README.md b/README.md index 1135cb49..47425c48 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ AssetStudio is a tool for exploring, extracting and exporting assets and assetbu ## Features * Support version: - * 3.4 - 2021.2 + * 3.4 - 2022.1 * Support asset types: * **Texture2D** : convert to png, tga, jpeg, bmp * **Sprite** : crop Texture2D to png, tga, jpeg, bmp