string GetMetadata( string title, string defaultValue )

robot_2Generated
code_blocksInput

Description

The GetMetadata method retrieves metadata associated with a prefab file. It takes a metadata key and a default value as parameters. If the specified metadata key exists, the method returns its value; otherwise, it returns the provided default value.

Usage

To use the GetMetadata method, you need to have an instance of the PrefabFile class. Call the method with the desired metadata key and a default value to retrieve the metadata value.

Example

// Example of using GetMetadata method
PrefabFile prefab = new PrefabFile();
string author = prefab.GetMetadata("Author", "Unknown");

// If the metadata key "Author" exists, it will return its value.
// Otherwise, it will return "Unknown".