概要
using UnityEditor; using UnityEngine; public sealed class ExampleClass : EditorWindow { [MenuItem( "Tools/Example" )] private static void Example() { GetWindow<ExampleClass>(); } private void OnGUI() { var text = "ピカチュウ" ; var size = EditorStyles.label.CalcSize( text ); var rect = new Rect( 0, 0, size.x, size.y ); EditorGUI.DrawRect( rect, Color.white ); EditorGUI.LabelField( rect, text ); } }