Module systems_scenes_scene
Stores a scene's game objects and provides scene lifecycle operations.
Info:
- Author: Sharper Dev
Functions
| Scene:new (name) | Creates a scene with an empty game-object list. |
| Scene:addGameObject (gameObject) | Adds a game object, assigns its scene and list index, and returns it. |
| Scene:setupUnload () | Disables every game object in preparation for unloading. |
| Scene:unload () | Destroys all game objects and clears the scene's object and component references. |
Functions
- Scene:new (name)
-
Creates a scene with an empty game-object list.
Parameters:
- name string Scene name.
Returns:
-
Scene The new scene.
Usage:
local scene = Scene:new("my_scene")
- Scene:addGameObject (gameObject)
-
Adds a game object, assigns its scene and list index, and returns it.
Parameters:
- gameObject GameObject Object to add.
Returns:
-
GameObject The added object.
Usage:
local addedObject = scene:addGameObject(gameObject)
- Scene:setupUnload ()
- Disables every game object in preparation for unloading.
- Scene:unload ()
- Destroys all game objects and clears the scene's object and component references. Called when the scene transitions to another scene.