Hi,
I’m trying to improve my programming and i’m looking into setting up a class that generates a tile map. I got that far and i started thinking about having different kinds of tiles.
Dirt tiles, floor tiles, rock, etc etc. So I setup a BaseTile class and for each type of tile i’d create their own class and extend the BaseTile class. But then i started thinking about how i could generate the associated geometry that should go along with the class.
What do i do now? Setup a prefab for each class of tile and add the appropriate script to each tile? I’m more used to the Flash approach still and in my head i’m still all about var dirtTile:smile:irtTile = new DirtTile();
With the knowledge i have now, i think the way to tackle this is just with prefabs. Is this correct?
As for the bonus question: Is it possible to use the polymorphism approach in unity3d? If so, could you show me how.