-
Notifications
You must be signed in to change notification settings - Fork 190
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
Out of range error while importing array of enum values #53
Comments
Hey, you are not the only one try to use array for `enum' type. :-)
|
[Flags]
public enum ArticleAction
{
NoAction = 2,
TakeOn = 4,
Recycle = 8,
Open = 16,
} So I can use Switch selection statement to choose what buttons to show and what actions to apply. For example I can Open a chest and can TakeOn or Recycle a weapon. Several years ago I worked as game designer on project where programmers used bit flags to configure actions for items. It was easy enoth for me, so I liked this idea - one number to describe item actions. may be i could use one enum to describe differen cases like "TakeOnAndRicycle", "TakeOnAndOpen"... or I could use int field of sum of bit flags like i had to use on that project... and I would have done so if I had not dealt whith bug my way. |
I agree. Supporting I'll look it later. Also I found some related pages with googling for references purpose: |
I'm using QuickSheet to import data from google sheets. I've tryed to import array of enum alues. QuickSheet imports data correctly (it whould be much better if you mention about flags ability of enums in documentation... i was expecting an array of enums though flags enum is more correctly). But watching on data scriptable object in Inspector leads to massive oet of range error messages spam. They appear because enumValueIndex in
GUIHelper
class can't handle whith multivalue enum. If enum property is multivalue the enumValueIndex returns -1 which leads to error message.I've added some code to solve the problem my way, but i'm not experienced enouth to find professional solution of this problem.
Sorry if doublig...
The text was updated successfully, but these errors were encountered: