Description
The Scene
property of the MapWorld
class provides access to the Sandbox.Scene
associated with this map world. This property is essential for interacting with the scene graph, allowing you to manipulate and query the scene's components and objects.
Usage
Use the Scene
property to access the scene associated with a MapWorld
instance. This can be useful for operations such as adding or removing game objects, querying scene components, or performing scene-specific logic.
Example
// Example of accessing the Scene property
MapWorld mapWorld = new MapWorld();
Scene scene = mapWorld.Scene;
// Perform operations on the scene
GameObject newObject = new GameObject();
scene.Add(newObject);
// Query the scene
var allComponents = scene.GetComponents<Component>();