This commit is contained in:
SoulliesOfficial
2025-09-19 23:39:23 -04:00
parent f612d5bcd4
commit a9bc898e4c
130 changed files with 227554 additions and 24284 deletions

View File

@@ -29,29 +29,12 @@ public abstract class ShaderFlagsBase
return _material;
}
protected abstract int GetShaderFlagsId(int index = 0);
public abstract int GetShaderFlagsId(int index = 0);
protected abstract string GetShaderFlagsName(int index = 0);
private void SetIntValue(Material material, int flagBits,int index = 0)
{
#if UNITY_EDITOR
// SerializedObject serializedObject = new SerializedObject(_material);
// SerializedProperty serializedProperty = serializedObject.FindProperty("m_SavedProperties");
// serializedProperty = serializedProperty.FindPropertyRelative("m_Floats");
// for (int index = serializedProperty.arraySize - 1; index >= 0; index--)
// {
// var property = serializedProperty.GetArrayElementAtIndex(index);
// string propertyName = property.displayName;
// if (propertyName == "_W9PBRStandardShaderFlags")
// {
// var propertyType = property.propertyType;
// Debug.Log("xxx: "+propertyType);
//
//
// property.floatValue = (float) (flags | flagBits);
// }
// }
// material.SetInt(GetShaderFlagsName(), flagBits);
material.SetInteger(GetShaderFlagsId(index), flagBits);
#else
material.SetInteger(GetShaderFlagsId(index), flagBits);