- [Core] Revert change
This commit is contained in:
@@ -18,44 +18,44 @@ namespace AssetStudio
|
|||||||
|
|
||||||
public class UnityPropertySheet
|
public class UnityPropertySheet
|
||||||
{
|
{
|
||||||
public KeyValuePair<string, UnityTexEnv>[] m_TexEnvs;
|
public Dictionary<string, UnityTexEnv> m_TexEnvs;
|
||||||
public KeyValuePair<string, int>[] m_Ints;
|
public Dictionary<string, int> m_Ints;
|
||||||
public KeyValuePair<string, float>[] m_Floats;
|
public Dictionary<string, float> m_Floats;
|
||||||
public KeyValuePair<string, Color>[] m_Colors;
|
public Dictionary<string, Color> m_Colors;
|
||||||
|
|
||||||
public UnityPropertySheet(ObjectReader reader)
|
public UnityPropertySheet(ObjectReader reader)
|
||||||
{
|
{
|
||||||
var version = reader.version;
|
var version = reader.version;
|
||||||
|
|
||||||
int m_TexEnvsSize = reader.ReadInt32();
|
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++)
|
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
|
if (version[0] >= 2021) //2021.1 and up
|
||||||
{
|
{
|
||||||
int m_IntsSize = reader.ReadInt32();
|
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++)
|
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();
|
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++)
|
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();
|
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++)
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user