Skip to content

format

typescript
DataLibrary.FileExists(file_name)

class: DataLibrary

description

Check if there is data stored under the specified key.

parameter

param_nametypedescription
file_namestringThe key value.

reture

typedescription
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");
}