Scene - Team-Innis/UtH-Engine GitHub Wiki
Everything that happens in game actually happens inside a scene.
You can have multiple scenes inside one game and switch between them (ie. Menu & Game -scenes).
Creating new project starts by inheriting scene and declaring it to SceneManager.
You add all gameobjects to scene or to layers which are always inside scenes.
Required functions
-
Init()
Happens when you load scene and hopefully used to initialize values.
-
Update(float deltaTime)
Happens every frame. Also gives deltatime so movement and other stuff can be bound to it.
-
Draw()
Happens every frame. Declaring what stuff is actually drawn to screen should happen here.
-
Deinit()
Happens once game ends or you switch to next scene.
Of course you can also declare your own custom functions to be used.
Usage
To switch between scenes, call uthSceneM.GoToScene(0);
in a scene. Scene will change before next update call.