mirror of
https://github.com/codewriter-packages/Tri-Inspector.git
synced 2025-01-22 00:08:51 -05:00
Fix TooltipAttribute not working and expose TriEditor.OnEnable and TriEditor.OnDisable (#144)
This commit is contained in:
parent
e825652e45
commit
7eb8291c31
@ -7,12 +7,12 @@ namespace TriInspector.Editors
|
||||
{
|
||||
private TriEditorCore _core;
|
||||
|
||||
private void OnEnable()
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
_core = new TriEditorCore(this);
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
protected virtual void OnDisable()
|
||||
{
|
||||
_core.Dispose();
|
||||
}
|
||||
|
@ -6,9 +6,14 @@ namespace TriInspector.Elements
|
||||
{
|
||||
private readonly GUIContent _label;
|
||||
|
||||
public TriLabelElement(string label)
|
||||
public TriLabelElement(string label, string tooltip = "")
|
||||
{
|
||||
_label = new GUIContent(label);
|
||||
_label = new GUIContent(label, tooltip);
|
||||
}
|
||||
|
||||
public TriLabelElement(GUIContent label)
|
||||
{
|
||||
_label = label;
|
||||
}
|
||||
|
||||
public override float GetHeight(float width)
|
||||
|
@ -102,6 +102,10 @@ namespace TriInspector
|
||||
{
|
||||
CustomTooltip = ValueResolver.ResolveString(this, tooltipAttribute.Tooltip);
|
||||
}
|
||||
else if (Attributes.TryGet(out TooltipAttribute unityTooltipAttribute))
|
||||
{
|
||||
CustomTooltip = new ConstantValueResolver<string>(unityTooltipAttribute.tooltip);
|
||||
}
|
||||
}
|
||||
|
||||
public Type OwnerType { get; }
|
||||
|
Loading…
Reference in New Issue
Block a user