Unity3d-Tags-Filters
Extending a Unity3d Inspector window to show int tags
What is it?
Tag filter is a small snippet for Unity that allows logically group your int variables in the inspector. It doesn't compete with enums. It is useful when you want to keep things dead simple without unnecessary cast ints to enums.
public class DemoTags : MonoBehaviour
{
// use TagFilter attribute with class type that hold your const ints.
[TagFilter(typeof(Tags))] public int tag;
}
public static class Tags
{
// use tagfiled attribute with param caterogy name.
[TagField(categoryName = "entities")] public const int Players = 0;
[TagField(categoryName = "entities")] public const int Enemies = 1;
[TagField(categoryName = "signals")] public const int SignalAttack = 2;
[TagField(categoryName = "signals")] public const int SignalDamage = 3;
[TagField(categoryName = "signals/effects")] public const int SignalStun = 3;
}
Other content
- InspectorFoldoutGroup - an extension to add foldable groups to the inspector.
- ACTORS - Unity3d data-driven framework I'm currently working on.