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

22 lines
733 B
C#

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
{
title = attribute.Title,
titleMode = TriBoxGroupElement.TitleMode.Foldout,
expandedByDefault = attribute.Expanded,
hideIfChildrenInvisible = true,
});
}
}
}