ES2.Exists
public static bool Exists(string path, ES2Settings settings=null)
Parameters
[table th=”0″]path,”The Path of the file, folder or data we want to check exists. Path can be a file, folder or tag.”
settings,”Optional. A user-created ES2Settings object containing options not specified in path.”[/table]
Returns
[table th=”0″]bool,”True or False, depending on whether data exists.”[/table]
Description
Checks if the file, folder or data at a specified path exists.
C#
// Check that a file named 'myFile.txt' contains a tag named 'myPosition' before loading it. if(ES2.Exists("myFile.txt?tag=myPosition")) transform.position = ES2.Load<Vector3>("myFile.txt?tag=myPosition");
JS
// Check that a file named 'myFile.txt' contains a tag named 'myPosition' before loading it. if(ES2.Exists("myFile.txt?tag=myPosition")) transform.position = ES2.Load<Vector3>("myFile.txt?tag=myPosition");