Files
BABA_YAGA/Packages/app.rive.rive-unity/Editor/Components/RiveWidgetInspector.cs
2026-05-19 17:39:03 +07:00

40 lines
1.0 KiB
C#

using System.Collections;
using System.Collections.Generic;
using Rive.Components;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;
namespace Rive.EditorTools
{
[CustomEditor(typeof(WidgetBehaviour), true)]
internal class RiveWidgetInspector : RiveBaseEditor
{
public override VisualElement CreateInspectorGUI()
{
var root = base.CreateInspectorGUI();
if (target is RiveWidget widget)
{
var playgroundRow = new VisualElement();
playgroundRow.style.marginTop = 6;
var playgroundButton = new Button(() =>
{
DataBindingPlaygroundWindow.Open(widget);
})
{
text = "Open Playground",
tooltip = "Open a data binding playground for this widget"
};
playgroundRow.Add(playgroundButton);
root.Add(playgroundRow);
}
return root;
}
}
}