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