format
typescript
DataLibrary.FileExists(file_name)class: DataLibrary
description
Check if there is data stored under the specified key.
parameter
| param_name | type | description |
|---|---|---|
| file_name | string | The key value. |
reture
| type | description |
|---|---|
boolean |
code example
typescript
let library = DataLibrary.projectLibrary;
let key = "testdata";
let content = "abcdefg";
// Set data
library.SetData(key,content);
// Check if there is data stored under the specified key
let result = library.FileExists(key);
if (result) {
Debug.Log(library.GetData(key));
}else{
Debug.Log("The data does not exist");
}