9using System.Collections;
10using System.Collections.Generic;
16 [CustomPropertyDrawer(typeof(LeapTextRenderer))]
18 private static float HELP_BOX_HEIGHT = EditorGUIUtility.singleLineHeight * 2;
20 protected override void init(SerializedProperty property) {
23 drawCustom(rect => { }, EditorGUIUtility.singleLineHeight * 0.5f);
25 drawCustom(rect => EditorGUI.LabelField(rect,
"Text Settings", EditorStyles.boldLabel),
26 EditorGUIUtility.singleLineHeight);
28 var fontProp =
property.FindPropertyRelative(
"_font");
30 Font font = fontProp.objectReferenceValue as Font;
31 if (font !=
null && !font.dynamic) {
32 rect.height = HELP_BOX_HEIGHT;
33 EditorGUI.HelpBox(rect,
"Only dynamic fonts are currently supported.", MessageType.Error);
34 rect.y += HELP_BOX_HEIGHT;
36 rect.height = EditorGUIUtility.singleLineHeight;
37 EditorGUI.PropertyField(rect, fontProp);
39 Font font = fontProp.objectReferenceValue as Font;
40 if (font !=
null && !font.dynamic) {
41 return HELP_BOX_HEIGHT + EditorGUIUtility.singleLineHeight;
43 return EditorGUIUtility.singleLineHeight;
void drawProperty(string name, bool includeChildren=true, bool disable=false)
void drawCustom(Action< Rect > drawFunc, float height)
void drawPropertyConditionally(string propertyName, string conditionalName, bool includeChildren=true)
override void init(SerializedProperty property)