Class MsdfEditorUtils
- Inheritance
-
Msdf
Editor Utils
- Inherited Members
Methods
DrawDistanceField(MaterialEditor, MaterialProperty, MaterialProperty)
Draws a distance field property.
public static void DrawDistanceField(this MaterialEditor editor, MaterialProperty distanceField, MaterialProperty pixelRange = null)
Parameters
editor
MaterialEditor distanceField
MaterialProperty pixelRange
MaterialProperty
DrawDistanceFieldPropertyNamePicker(SerializedProperty, Func<Object, IEnumerable<Material>>)
Draws a dropdown listing every texture property name that follows the conventions for a distance field in the given materials.
public static void DrawDistanceFieldPropertyNamePicker(SerializedProperty fieldPropertyName, Func<Object, IEnumerable<Material>> getMaterials)
Parameters
fieldPropertyName
SerializedProperty String property to store the result in.
getMaterials
Func<Object, IEnumerable<Material>>Called for each target object, returns each material to be searched.
DrawPerspectiveAwarePixelRange(MaterialEditor, MaterialProperty)
Draws the Perspective-aware toggle.
public static void DrawPerspectiveAwarePixelRange(this MaterialEditor editor, MaterialProperty perspectiveAware)
Parameters
editor
MaterialEditor Editor to draw the property in.
perspectiveAware
MaterialProperty The Perspective
Aware property.Pixel Range Keyword
DrawPixelRangeSource(MaterialEditor, MaterialProperty)
Draws the source properties as dropdowns.
public static void DrawPixelRangeSource(this MaterialEditor editor, MaterialProperty pixelRangeSource)
Parameters
editor
MaterialEditor The editor to draw them in.
pixelRangeSource
MaterialProperty The Pixel
Range property.Source Keyword Prefix
GetAssetFor(Texture)
Returns the Unity
Parameters
texture
Texture
Returns
- Sprite
TakeDistanceField(IDictionary<string, MaterialProperty>, string)
Removes the field texture property and its corresponding pixel range property from the dictionary, only if both exist.
public static (MaterialProperty Field, MaterialProperty PixelRange)? TakeDistanceField(IDictionary<string, MaterialProperty> unhandledProperties, string fieldName)
Parameters
unhandledProperties
IDictionary<string, MaterialProperty >The SetupScopes(IDictionary<string, MaterialProperty>) parameter.
fieldName
stringName of the distance field to take.
Returns
- (Material
Property Field, MaterialProperty PixelRange )? A tuple containing the field and its pixel range, or null if either property was not available.