lxpk / UnityBitMaskDrawer

Unity BitMaskDrawer implements a default inspector for bitmask flag enums allowing multiple enums without a custom inspector, originally by Bunny83

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UnityBitMaskDrawer

Unity BitMaskDrawer implements a default inspector for bitmask flag enums allowing multiple enums without a custom inspector, originally by Bunny83

SOURCE

What is a Bitmask and how do you programmers use them?

INSTRUCTIONS

  • To enable inspecting of your enums with multiple bitmask flags, add a decorator above your enum declarations like this:
public enum EMyEnum
{

	None         = 0x00,

	Cow          = 0x01,
		
	Chicken      = 0x02,
		
	Cat          = 0x04,
		
	Dog          = 0x08,
		
	CowChicken   = 0x03,
		
	CatDog       = 0x0C,
		
	All          = 0x0F,
	
}
	
	
[BitMask(typeof(EMyEnum))]
	
public EMyEnum someMask;

SEE ALSO

There are other examples that implement this concept available:

About

Unity BitMaskDrawer implements a default inspector for bitmask flag enums allowing multiple enums without a custom inspector, originally by Bunny83


Languages

Language:C# 100.0%