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
namespace and is used to manage and interact with the game objects defined in a scene file.
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 the GameObjects property
SceneFile sceneFile = new SceneFile();
// Assuming sceneFile is already loaded with data
JsonObject[] gameObjects = sceneFile.GameObjects;
foreach (var gameObject in gameObjects)
{
// Process each game object
// For example, print the JSON representation
string jsonRepresentation = gameObject.ToJsonString();
// Use the jsonRepresentation as needed
}