Tuesday, June 7, 2022
HomeGame DevelopmentMassive Textual content in Unity Inspector

Massive Textual content in Unity Inspector


Utilizing the PropertyDrawer as proposed by @DMGregory lastly works:

utilizing UnityEditor;
utilizing UnityEngine;

[CustomPropertyDrawer (typeof (LargeTextInGUI))]
public class LargeTextInGUIDrawer : PropertyDrawer
{
    public override void OnGUI (Rect place, SerializedProperty property, GUIContent label)
    {
        var fashion = new GUIStyle ();
        fashion.fontSize = 40;
        EditorGUI.LabelField (place, label.textual content, property.intValue.ToString(), fashion);
    }

    public override float GetPropertyHeight (SerializedProperty property, GUIContent label)
    {
        return 45;
    }
}
utilizing UnityEngine;

public class LargeTextInGUI : PropertyAttribute
{
}
public class MyClass: ScriptableObject{
    [LargeTextInGUI]
    public int currentState;
}

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments