Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

Commit

Permalink
- [Core] Revert change
Browse files Browse the repository at this point in the history
  • Loading branch information
Razmoth committed Aug 12, 2023
1 parent ded8050 commit 463f992
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions AssetStudio/Classes/Material.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,44 +18,44 @@ public UnityTexEnv(ObjectReader reader)

public class UnityPropertySheet
{
public KeyValuePair<string, UnityTexEnv>[] m_TexEnvs;
public KeyValuePair<string, int>[] m_Ints;
public KeyValuePair<string, float>[] m_Floats;
public KeyValuePair<string, Color>[] m_Colors;
public Dictionary<string, UnityTexEnv> m_TexEnvs;
public Dictionary<string, int> m_Ints;
public Dictionary<string, float> m_Floats;
public Dictionary<string, Color> m_Colors;

public UnityPropertySheet(ObjectReader reader)
{
var version = reader.version;

int m_TexEnvsSize = reader.ReadInt32();
m_TexEnvs = new KeyValuePair<string, UnityTexEnv>[m_TexEnvsSize];
m_TexEnvs = new Dictionary<string, UnityTexEnv>(m_TexEnvsSize);
for (int i = 0; i < m_TexEnvsSize; i++)
{
m_TexEnvs[i] = new KeyValuePair<string, UnityTexEnv>(reader.ReadAlignedString(), new UnityTexEnv(reader));
m_TexEnvs.Add(reader.ReadAlignedString(), new UnityTexEnv(reader));
}

if (version[0] >= 2021) //2021.1 and up
{
int m_IntsSize = reader.ReadInt32();
m_Ints = new KeyValuePair<string, int>[m_IntsSize];
m_Ints = new Dictionary<string, int>(m_IntsSize);
for (int i = 0; i < m_IntsSize; i++)
{
m_Ints[i] = new KeyValuePair<string, int>(reader.ReadAlignedString(), reader.ReadInt32());
m_Ints.Add(reader.ReadAlignedString(), reader.ReadInt32());
}
}

int m_FloatsSize = reader.ReadInt32();
m_Floats = new KeyValuePair<string, float>[m_FloatsSize];
m_Floats = new Dictionary<string, float>(m_FloatsSize);
for (int i = 0; i < m_FloatsSize; i++)
{
m_Floats[i] = new KeyValuePair<string, float>(reader.ReadAlignedString(), reader.ReadSingle());
m_Floats.Add(reader.ReadAlignedString(), reader.ReadSingle());
}

int m_ColorsSize = reader.ReadInt32();
m_Colors = new KeyValuePair<string, Color>[m_ColorsSize];
m_Colors = new Dictionary<string, Color>(m_ColorsSize);
for (int i = 0; i < m_ColorsSize; i++)
{
m_Colors[i] = new KeyValuePair<string, Color>(reader.ReadAlignedString(), reader.ReadColor4());
m_Colors.Add(reader.ReadAlignedString(), reader.ReadColor4());
}
}
}
Expand Down

0 comments on commit 463f992

Please sign in to comment.