Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Commit

Permalink
support 2022.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Perfare committed Jun 16, 2022
1 parent b70b519 commit d158e86
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
5 changes: 5 additions & 0 deletions AssetStudio/Classes/AnimationClip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,7 @@ public class GenericBinding
public ClassIDType typeID;
public byte customType;
public byte isPPtrCurve;
public byte isIntCurve;

public GenericBinding() { }

Expand All @@ -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();
}
}
Expand Down
5 changes: 5 additions & 0 deletions AssetStudio/Classes/Mesh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 11 additions & 1 deletion AssetStudio/Classes/Shader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand 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
{
Expand Down Expand Up @@ -690,6 +692,7 @@ public class SerializedProgram
{
public SerializedSubProgram[] m_SubPrograms;
public SerializedProgramParameters m_CommonParameters;
public ushort[] m_SerializedKeywordStateMask;

public SerializedProgram(ObjectReader reader)
{
Expand All @@ -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();
}
}
}

Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d158e86

Please sign in to comment.