Table of Contents

Class MsdfEditorUtils

Namespace
Kroltan.Keen.Editor
Assembly
me.kroltan.keen-vectors.Editor.dll
[PublicAPI]
public static class MsdfEditorUtils
Inheritance
MsdfEditorUtils
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 PerspectiveAwarePixelRangeKeyword property.

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 PixelRangeSourceKeywordPrefix property.

GetAssetFor(Texture)

Returns the UnityEngine.Sprite associated with this texture, if any.

public static Sprite GetAssetFor(Texture texture)

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 string

Name of the distance field to take.

Returns

(MaterialProperty Field, MaterialProperty PixelRange)?

A tuple containing the field and its pixel range, or null if either property was not available.