Skip to content

EnumFlags incorrectly treats HasFlag as toggled on mixed bits #20

@JoyousSuccess

Description

@JoyousSuccess

uh the EnumFlags thing doesnt work correctly as it should?
(or am i wrong lol? ... think i had this code totally working in Odin.. odin annoying tho lol)

i have this enum

[Flags]
public enum Bldg_DestructState {
	NONE = 0,
	TOP_LEFT = 1, TOP_RIGHT = 2,
	BOT_LEFT = 4, BOT_RIGHT = 8,
	ADJ_LEFT = 16, ADJ_RIGHT = 32,
	FOUR = TOP_LEFT | TOP_RIGHT | BOT_LEFT | BOT_RIGHT
}

and your attribute thingy
it will make the FOUR be an OR ... but its and AND... right.. ?
also your on off replacing 0 ?

see this : https://giannisakritidis.com/blog/Enum-Flags-In-Unity/
info

... when i select TOP_RIGHT .. it also selects FOUR...

info2

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions