- [Core] Added shader flags.

This commit is contained in:
Razmoth
2024-02-10 08:09:39 +04:00
parent 5db1b59090
commit 2e268e6283
2 changed files with 20 additions and 3 deletions

View File

@@ -690,7 +690,10 @@ namespace AssetStudio
{
sb.Append($"[{m_Attribute}] ");
}
//TODO Flag
foreach (var flag in Enum.GetValues<SerializedPropertyFlag>().Where(x => m_Prop.m_Flags.HasFlag(x)))
{
sb.Append($"[{flag}] ");
}
sb.Append($"{m_Prop.m_Name} (\"{m_Prop.m_Description}\", ");
switch (m_Prop.m_Type)
{

View File

@@ -89,13 +89,27 @@ namespace AssetStudio
Int = 5
};
[Flags]
public enum SerializedPropertyFlag
{
HideInInspector = 1 << 0,
PerRendererData = 1 << 1,
NoScaleOffset = 1 << 2,
Normal = 1 << 3,
HDR = 1 << 4,
Gamma = 1 << 5,
NonModifiableTextureData = 1 << 6,
MainTexture = 1 << 7,
MainColor = 1 << 8,
}
public class SerializedProperty
{
public string m_Name;
public string m_Description;
public string[] m_Attributes;
public SerializedPropertyType m_Type;
public uint m_Flags;
public SerializedPropertyFlag m_Flags;
public float[] m_DefValue;
public SerializedTextureProperty m_DefTexture;
@@ -105,7 +119,7 @@ namespace AssetStudio
m_Description = reader.ReadAlignedString();
m_Attributes = reader.ReadStringArray();
m_Type = (SerializedPropertyType)reader.ReadInt32();
m_Flags = reader.ReadUInt32();
m_Flags = (SerializedPropertyFlag)reader.ReadUInt32();
m_DefValue = reader.ReadSingleArray(4);
m_DefTexture = new SerializedTextureProperty(reader);
}