ES3.GetKeys
Description
Gets an array of key names from a file.
Parameters
filePath | [Optional] The relative or absolute path of the file we want to get the keys from. |
settings |
[Optional] The settings we want to use to override the default settings. |
Returns
An array of key names.
Examples
C#
1 2 3 4 5 6 7 8 9 10 11 |
// Save some keys to a file. ES3.Save<int>("key1", 123, "myFile.es3"); ES3.Save<int>("key2", 456, "myFile.es3"); ES3.Save<int>("key3", 789, "myFile.es3"); // Now get the keys from file and log them to console. foreach(var key in ES3.GetKeys("myFile.es3")) Debug.Log(key); // Outputs: // key1 // key2 // key3 |
JS
1 2 3 4 5 6 7 8 9 10 11 |
// Save some keys to a file. ES3.Save.<int>("key1", 123, "myFile.es3"); ES3.Save.<int>("key2", 456, "myFile.es3"); ES3.Save.<int>("key3", 789, "myFile.es3"); // Now get the keys from file and log them to console. foreach(var key in ES3.GetKeys("myFile.es3")) Debug.Log(key); // Outputs: // key1 // key2 // key3 |