ES2.Exists
Parameters
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. |
Returns
bool | True or False, depending on whether data exists. |
Description
Checks if the file, folder or data at a specified path exists.
C#
1 2 3 |
// 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
1 2 3 |
// 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"); |