Example #1
0
 private static void DrawCustomFun(ref DrawPropertyContext context)
 {
     if (context.spi.property != null)
     {
         if (context.spi.shaderFeature.readOnly)
         {
             EditorGUILayout.Vector4Field(context.spi.property.displayName, context.spi.property.vectorValue);
         }
         else
         {
             EditorGUI.BeginChangeCheck();
             CustomPropertyDrawer.OnGUI(context.spi.property, context.materialEditor, context.spi.shaderFeature);
             if (EditorGUI.EndChangeCheck())
             {
                 Undo.RecordObject(context.materialEditor.target, context.spi.property.displayName);
             }
         }
     }
 }
Example #2
0
 private static void DrawCustomGroupFun(ref DrawPropertyContext context)
 {
     if (context.spi.property != null && context.spi.scp != null)
     {
         var scp = context.spi.scp;
         if (context.spi.shaderFeature.readOnly)
         {
             EditorGUILayout.FloatField(scp.desc, context.spi.property.vectorValue[context.spi.customIndex]);
         }
         else
         {
             EditorGUI.BeginChangeCheck();
             CustomPropertyDrawer.OnGUI(context.spi.property, context.materialEditor, scp, context.spi.customIndex);
             if (EditorGUI.EndChangeCheck())
             {
                 Undo.RecordObject(context.materialEditor.target, context.spi.property.displayName);
             }
         }
     }
 }