浏览代码

[Material node] use color property instead of field.

/main
Tim Cooper 8 年前
当前提交
ff11a50c
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 6
      MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/ColorNode.cs

6
MaterialGraphProject/Assets/UnityShaderEditor/Runtime/Nodes/ColorNode.cs


public override void GeneratePropertyBlock(PropertyGenerator visitor, GenerationMode generationMode)
{
if (exposedState == ExposedState.Exposed)
visitor.AddShaderProperty(new ColorPropertyChunk(propertyName, description, m_Color, PropertyChunk.HideState.Visible));
visitor.AddShaderProperty(new ColorPropertyChunk(propertyName, description, color, PropertyChunk.HideState.Visible));
}
public override void GeneratePropertyUsages(ShaderGenerator visitor, GenerationMode generationMode)

if (exposedState == ExposedState.Exposed || generationMode.IsPreview())
return;
visitor.AddShaderChunk(precision + "4 " + propertyName + " = " + precision + "4 (" + m_Color.r + ", " + m_Color.g + ", " + m_Color.b + ", " + m_Color.a + ");", true);
visitor.AddShaderChunk(precision + "4 " + propertyName + " = " + precision + "4 (" + color.r + ", " + color.g + ", " + color.b + ", " + color.a + ");", true);
}
public override PreviewProperty GetPreviewProperty()

m_Name = propertyName,
m_PropType = PropertyType.Color,
m_Color = m_Color
m_Color = color
};
}
}
正在加载...
取消
保存