I have a project where I need to have several different variations of one class, and my system works fine except that I can’t apply these overloaded classes to any objects.
My project works like this: I have a ‘buildingBlock’ class, which has functions to be placed and deleted. I want to have a block that has more functions, for example a door that can be opened and closed. For this, I have made a class ‘doorBlock’ that inherits from ‘buildingBlock’ and this works fine in code, but because I made this overload class inside the ‘buildingBlock’ script I can’t apply it to any objects.
My question is whether I should have the ‘doorBlock’ class in another script, or if there’s some way to choose between classes inside of a script from the editor. Doing it either way isn’t really a problem, it just seems like it would be a mess to have a bajillion different scripts that are all slightly different.