int GetInt( string keyName, int defaultValue )

book_4_sparkGenerated
code_blocksInput

Description

The GetInt method retrieves an integer value associated with a specified key from the metadata. If the key does not exist, it returns a default value provided by the user.

Usage

Use this method when you need to retrieve an integer value from the metadata. Provide the key name as a string and a default integer value that will be returned if the key is not found.

Example

// Example usage of GetInt method
Editor.MetaData metaData = new Editor.MetaData();
int value = metaData.GetInt("playerScore", 0);

// If "playerScore" exists in the metadata, its value is returned.
// Otherwise, the default value 0 is returned.