Is it possible to treated enumerated values as part of a collection for the purpose of populating an array with all enumerated values? For example, I’m working on a ResourceManager class that will keep an array of all possible ResourceTypes. ResourceTypes are enumerated values, such as “food”, “stone”, “wood”, etc.
What I want is to be able to tell the ResourceManager, on Awake(), to create an array of all possible resource types by using every possible enumerated value. How do I get it to create a array with the same number of elements as are in ResourceTypes? Once I get that far, I know how to add them in.
I am trying to avoid having to hard code adding each type to the array. That allows me to change the list of ResourceTypes without having to then go to the ResourceManager and add/delete the appropriate lines of code.