ES2Reader.TagExists
Parameters
tag | The tag we want to check the existence of in our ES2Reader. |
Returns
bool | True or False, depending on whether tag exists. |
Description
Checks if the specified tag exists in this ES2Reader.
C#
1 2 3 4 5 6 |
// Check that a file named 'myFile.txt' contains a tag named 'myPosition' before loading it. using(ES2Reader reader = ES2Reader.Create("myFile.txt")) { if(reader.TagExists("myPosition")) transform.position = reader.Read<Vector3>("myPosition"); } |
JS
1 2 3 4 5 |
// Check that a file named 'myFile.txt' contains a tag named 'myPosition' before loading it. var reader : ES2Reader = ES2Reader.Create("myFile.txt"); if(reader.TagExists("myPosition")) transform.position = reader.Read.<Vector3>("myPosition"); reader.Dispose(); |