mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-23 08:48:21 -05:00
24 lines
517 B
C#
24 lines
517 B
C#
|
using UnityEngine;
|
|||
|
|
|||
|
namespace TriInspector.Elements
|
|||
|
{
|
|||
|
public class TriLabelElement : TriElement
|
|||
|
{
|
|||
|
private readonly GUIContent _label;
|
|||
|
|
|||
|
public TriLabelElement(string label)
|
|||
|
{
|
|||
|
_label = new GUIContent(label);
|
|||
|
}
|
|||
|
|
|||
|
public override float GetHeight(float width)
|
|||
|
{
|
|||
|
return GUI.skin.label.CalcHeight(_label, width);
|
|||
|
}
|
|||
|
|
|||
|
public override void OnGUI(Rect position)
|
|||
|
{
|
|||
|
GUI.Label(position, _label);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|