bool GetBool( string keyName, bool defaultValue )

book_4_sparkGenerated
code_blocksInput

Description

The GetBool method retrieves a boolean 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

To use the GetBool method, you need to provide the key name as a string and a default boolean value. The method will return the boolean value associated with the key if it exists; otherwise, it will return the default value.

Example

// Example usage of GetBool method
Editor.MetaData metaData = new Editor.MetaData();

// Retrieve a boolean value with a key "isVisible". If the key doesn't exist, return false.
bool isVisible = metaData.GetBool("isVisible", false);

// Output the result
// isVisible will be true if the key exists and is set to true, otherwise false.