Class MsdfMaterialEditorBase
Extensible material editor for materials that use MSDFs.
- Inheritance
-
ShaderGUIMsdf
Material Editor Base
- Derived
- Inherited Members
-
ShaderGUI.
On Material PreviewGUI(Material Editor, Rect, GUIStyle) ShaderGUI.On Material Interactive PreviewGUI(Material Editor, Rect, GUIStyle) ShaderGUI.On Material Preview SettingsGUI(Material Editor) ShaderGUI.On Closed(Material) ShaderGUI.Assign New Shader ToMaterial(Material, Shader, Shader) ShaderGUI.Validate Material(Material)
Examples
By implementing SetupScopes(IDictionary<string, MaterialProperty>), you can create UIs separated into sections, or even extend existing sections if you are basing your material on a provided one.
public class MyAwesomerDecal : DecalMaterialEditor
{
private static readonly GUIContent MyCoolScope = new("Awesome Things");
protected void SetupScopes(IDictionary<string, MaterialProperty> unhandledProperties)
{
base.SetupScopes(unhandledProperties);
if (unhandledProperties.Remove("_AwesomeEffectColor", out var awesomeEffectColor)
{
AddToScope(MyCoolScope, editor =>
{
editor.ShaderProperty(awesomeEffectColor);
});
}
}
}
Fields
AdvancedOptionsScope
Scope containing specialist options, generally things with concern to performance or graphics workflow, rather than strictly visual parameters.
Field Value
- GUIContent
- See Also
SurfaceInputsScope
Scope containing general setup like colors, normals, and whatnot.
Field Value
- GUIContent
- See Also
Methods
AddToScope(GUIContent, ScopeDrawer)
Parameters
scopeGUIContentdrawMsdfMaterial .ScopeEditor Base Drawer
- See Also
DrawProperty<T>(MaterialProperty, Func<MaterialProperty, T>, Action<MaterialProperty, T>)
protected void DrawProperty<T>(MaterialProperty property, Func<MaterialProperty, T> draw, Action<MaterialProperty, T> assign)
Parameters
Type Parameters
T
- See Also
OnGUI(MaterialEditor, MaterialProperty[])
Parameters
materialEditorMaterialEditor propertiesMaterialProperty []
- See Also
SetupScopes(IDictionary<string, MaterialProperty>)
Called during the GUI lifecycle, you can call Add
Parameters
unhandledPropertiesIDictionary<string, MaterialProperty >Material properties that have not been handled by any drawer yet, indexed by name. Make sure to remove the ones you plan on drawing.
- See Also