System.Text.Json.Nodes.JsonObject[] GameObjects { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The GameObjects property of the SceneFile class provides access to an array of JsonObject instances, each representing a game object within the scene. This property is part of the Sandbox.SceneFile class, which is used to manage and manipulate scene data in the s&box game engine.

Usage

To access the game objects in a scene, you can use the GameObjects property of a SceneFile instance. This property returns an array of JsonObject, where each object contains the data for a specific game object in the scene. You can iterate over this array to process or modify the game objects as needed.

Example

// Example of accessing GameObjects from a SceneFile
SceneFile sceneFile = new SceneFile();

// Access the GameObjects property
JsonObject[] gameObjects = sceneFile.GameObjects;

// Iterate over each game object
foreach (JsonObject gameObject in gameObjects)
{
    // Process each game object
    // For example, print the game object's data
    string jsonData = gameObject.ToJsonString();
    // Use jsonData as needed
}