I have a parallax component and I’d like to let the user pick either PaperSprite
or PaperTileMap
assets for the background assets. At the moment it’s just an array of references to Object.
Then the component creates appropriate actors based on the type of asset and adds them to the array of actors. It works: I can pick either PaperSprite
or PaperTileMap
and then the component correctly creates actor based on picked items.
The problem is that I can pick any type: any blueprints, textures, whatever.
And it’s already causing bugs and I already lost time to debug it and realize that I picked a texture and not a sprite.
Alternative is to have separate arrays for paper tile maps and sprites but it’s
Is there something like std::variant or something in Unreal that would let me have a list of types in the array?
Or just somehow restrict the types I can pick in the editor with one of those Unreal macros in C++?