ES3.KeyExists

public static bool KeyExists(string key, string filePath, ES3Settings settings)

Description

Checks whether a key exists in a file.

Parameters

[table th=”0″]key,”The key we want to check the existence of.”

filePath,”[Optional] The relative or absolute path of the file we want to search for the key.”

settings,”[Optional] The settings we want to use to override the default settings.”[/table]

Returns

True if the key exists, or false if the key or file does not exist.

Examples

C#

// Checks whether a key exists in the default file before loading
if(ES3.KeyExists("myInt"))
    myInt = ES3.Load<int>("myInt");

JS

// Checks whether a key exists in the default file before loading
if(ES3.KeyExists("myInt"))
    myInt = ES3.Load.<int>("myInt");