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

22 lines
733 B
C#
Raw Normal View History

2022-11-13 05:38:45 -05:00
using TriInspector;
using TriInspector.Elements;
using TriInspector.GroupDrawers;
[assembly: RegisterTriGroupDrawer(typeof(TriFoldoutGroupDrawer))]
namespace TriInspector.GroupDrawers
{
public class TriFoldoutGroupDrawer : TriGroupDrawer<DeclareFoldoutGroupAttribute>
{
public override TriPropertyCollectionBaseElement CreateElement(DeclareFoldoutGroupAttribute attribute)
{
return new TriBoxGroupElement(new TriBoxGroupElement.Props
2022-11-13 05:38:45 -05:00
{
title = attribute.Title,
titleMode = TriBoxGroupElement.TitleMode.Foldout,
2022-11-13 05:38:45 -05:00
expandedByDefault = attribute.Expanded,
hideIfChildrenInvisible = true,
2022-11-13 05:38:45 -05:00
});
}
}
}