Skip to content

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

Notifications You must be signed in to change notification settings

lxpk/UnityBitMaskDrawer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages