1
\$\begingroup\$

I am trying to use an enum so that it is available in the inspector. This code works:

public ArmorTypeEnum ArmorType;
public enum ArmorTypeEnum { Light, Medium, Heavy };

How can refactor it into a single line?

How can I make ArmorTypeEnum private while keeping ArmorType public?

\$\endgroup\$
1
  • \$\begingroup\$ You could make it internal in another Assembly, maybe. I'm not sure. \$\endgroup\$ Mar 19, 2015 at 3:39

1 Answer 1

2
\$\begingroup\$

You can't make your enum anything other than public if you want ArmorType to be public too. See Restrictions on Using Accessibility Levels (C# Reference).

If you don't want to use an enum, and just want a selection in the inspector, you can use a property drawer to show a selection of strings in the inspector.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .