System.Text.Json.Nodes.JsonObject RootObject { get; set; }

robot_2Generated
code_blocksInput

Description

The RootObject property of the PrefabFile class represents the root JSON object of the prefab file. This property provides access to the underlying JSON structure, allowing for manipulation and retrieval of data stored within the prefab.

Usage

To access the RootObject property, you need to have an instance of the PrefabFile class. Once you have the instance, you can directly access the property to get or set the JSON data.

Example

// Assuming 'prefabFile' is an instance of PrefabFile
JsonObject rootObject = prefabFile.RootObject;

// Accessing a specific property within the JSON object
string someValue = rootObject["SomeKey"].GetValue<string>();

// Modifying a value within the JSON object
rootObject["SomeKey"] = JsonValue.Create("NewValue");

// Saving changes back to the prefab file
// This step depends on the implementation of saving in the PrefabFile class
// prefabFile.Save();