You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/Feel/MMTools/Tools/MMAttributes/MMInspectorGroupAttribute.cs

26 lines
976 B
C#

2 months ago
using System;
using UnityEngine;
namespace MoreMountains.Tools
{
/// <summary>
/// An attribute used to group inspector fields under common dropdowns
/// Implementation inspired by Rodrigo Prinheiro's work, available at https://github.com/RodrigoPrinheiro/unityFoldoutAttribute
/// </summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Struct, Inherited = true)]
public class MMInspectorGroupAttribute : PropertyAttribute
{
public string GroupName;
public bool GroupAllFieldsUntilNextGroupAttribute;
public int GroupColorIndex;
public MMInspectorGroupAttribute(string groupName, bool groupAllFieldsUntilNextGroupAttribute = false, int groupColorIndex = 24)
{
if (groupColorIndex > 139) { groupColorIndex = 139; }
this.GroupName = groupName;
this.GroupAllFieldsUntilNextGroupAttribute = groupAllFieldsUntilNextGroupAttribute;
this.GroupColorIndex = groupColorIndex;
}
}
}