The title pretty much says it all.
Essentially, I've got an Enum in my game that's got names of 5 different classes. I want to be able to access the appropriate class based on which Enum value is selected and spawn an object of that class. Right now, the only way I know how to do it is through Branch checks, but I think Arrays would be more efficient.
However, I haven't been able to find a way to create an Array of classes, so if anyone knows how to do that, I'd really appreciate the help. Thanks a lot.
Essentially, I've got an Enum in my game that's got names of 5 different classes. I want to be able to access the appropriate class based on which Enum value is selected and spawn an object of that class. Right now, the only way I know how to do it is through Branch checks, but I think Arrays would be more efficient.
However, I haven't been able to find a way to create an Array of classes, so if anyone knows how to do that, I'd really appreciate the help. Thanks a lot.
Comment