Description
The Serialize
method in the PrefabScene
class is responsible for converting the current state of the prefab scene into a JSON object. This method is useful for saving the scene's configuration and state in a format that can be easily stored or transmitted.
Usage
To use the Serialize
method, you need to call it on an instance of PrefabScene
. You must provide a SerializeOptions
parameter, which specifies the options for serialization, such as whether to include certain components or properties.
Example usage:
PrefabScene myScene = new PrefabScene();
Sandbox.GameObject.SerializeOptions options = new Sandbox.GameObject.SerializeOptions();
System.Text.Json.Nodes.JsonObject jsonObject = myScene.Serialize(options);
Example
PrefabScene myScene = new PrefabScene();
Sandbox.GameObject.SerializeOptions options = new Sandbox.GameObject.SerializeOptions();
System.Text.Json.Nodes.JsonObject jsonObject = myScene.Serialize(options);