Declaring and Accessing enums

You need to define the enum structure with all the values you want to show in the Inspector window. Create a public field with this custom enum type in the example: gameDifficulty. Use the enum in your code accessing the enum label string using the ToString() method on your variable.

Custom Enum value

You can always use the enum variable like integer variables with their numeric value starting from 0 up to the size-1 or you can define a different int value like I have done with the values 100, 200, 300, ...

Access Enum numeric value

To access the integer value of an enum you can simply cast them with the (int):

Debug.Log( (int) gameDifficulty)

Access Enum label/string value

To access the integer value of an enum you can simply use the ToString function:

Debug.Log( gameDifficulty.ToString() )

Create an Enum from a numeric value

To create an enum from an integer value you can use a reverse cast from Int to your specific enum type easily like this: