Hi all,
I’m making a game that will have lots of levels. Each level will have a bunch of gameObjects that the player can interact with, and no terrain/scenery at all, they just float in space. Each level’s loadout of gameObjects and each level’s objective to win will be different and thus needs to be individually scriptable.
So the best way I can think of to organise this is to have a base level class that will contain default functions for loadout and win conditions, and functions for every possible event and every possible variable that could be needed in any particular level.
Then to make a new level i just create a new c# script and create a class:
public class Level_5 : LevelBaseClass
{
[INDENT]loadout()
{
[INDENT] // unique loadout code here. eg, instantiate 10 penguins and 5 elephants.
[/INDENT]
}
[/INDENT]
... more level specific code
}
The LevelBaseClass can be a scriptableObject which should work nicely. But does each level instance have to be attached to a gameObject in the scene? Is that true, or is there a way that I can access these classes without them all being attached to a gameObject?
Basically I don’t really see the point of using Scenes for my game if all gameObjects are placed by code anyway. But if every single level script needs to be attached to an object in the scene, then I may well end up using scenes just so that I dont have a hundered or more level scripts in the scene at the same time. Does anyone have a nice tidy solution?