-
-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enum Flags throw error if user already defined Everything/Nothing #257
Comments
Whoa, that's strange! In fact, in #47, I don't do anything with MyBox — I just provide a brief explanation to the guy about how the Flags work. Unity automatically adds No worries, though! This behavior is optional. Just toggle off "Inspector override" and it should work fine. Let me know if it's crucial for you to keep Foldout or ButtonMethod in your project. I'll work on disabling the Inspector override per MB or SO where you are using the enums in question — that's the best solution I can offer for now. In the meantime, I'll put together an issue report for the Unity team to investigate 👍🏻 |
Thanks! ButtonMethod is crucial for me but I've worked around it by removing all declarations of |
I couldn't resist trying for a hotfix while the Unity bug still exists. What I came up with was to change part of the Body method of FoldoutAttribute.cs to something like this:
Still some work to be done there as it doesn't differentiate between flags and enums yet. However, I can imagine that as a principal you don't want hotfixes for Unity bugs in the code, as it makes the code prone for future bugs. But if you think it's a path worth pursuing, just let me know and I'll see if I can create a PR. |
Oh my, that's the reason I shouldn't work late at night 😅 The idea to try specific Enum and Mask Fields instead of PropertyField is evaded from me. Glad that it works! PR is welcomed 👐🏻 |
First of all, thanks for creating this great tool.
My issue arises when creating enum flags, I usually already include the
everything
andnothing
in my own code. For example:Implementing an enum flag like above in a monobehaviour will prevent the inspector from being drawn and writes an error to the console:
My guess my code seems to clash with something in MyBox, I guess having to do with #47. I found out I could fix it by not declaring
everything
andnothing
anymore, which is okay for me. Not sure if this can be fixed, otherwise a more specific error telling the user not to declareeverything
andnothing
themselves might be helpful, because it took me some time before I figured out what was wrong.The text was updated successfully, but these errors were encountered: