Tri-Inspector/Editor.Extras/GroupDrawers/TriToggleGroupDrawer.cs

22 lines
731 B
C#

using TriInspector;
using TriInspector.Elements;
using TriInspector.GroupDrawers;
[assembly: RegisterTriGroupDrawer(typeof(TriToggleGroupDrawer))]
namespace TriInspector.GroupDrawers
{
public class TriToggleGroupDrawer : TriGroupDrawer<DeclareToggleGroupAttribute>
{
public override TriPropertyCollectionBaseElement CreateElement(DeclareToggleGroupAttribute attribute)
{
return new TriBoxGroupElement(new TriBoxGroupElement.Props
{
title = attribute.Title,
titleMode = TriBoxGroupElement.TitleMode.Toggle,
expandedByDefault = attribute.Collapsible,
hideIfChildrenInvisible = true,
});
}
}
}