What are Enums

Al Heck
Oct 18, 2021

Create readable selections based off of integer values! For a difficulty selection screen, instead of doing them as int values (0 for easy, 1 for medium, etc), we can use an enum as a variable. Be sure the last value has no comma.

Then you can go through the items as a if statement

Or you can use a switch statement

--

--

Al Heck

Unity Developer and Software Engineer who loves making games with GameDevHQ