Tags: Saving Multiple Variables to One File
Easy Save allows you to save multiple pieces of data to one file using tags, which can be specified as a path parameter.
Saving to a tag which already exists will overwrite that tag.
You can save data of different types to a file using tags, and load them in any order.
You can also use ES2.Delete(path) to delete tags, or delete a file to delete all tags in that file.
C#
1 2 3 4 5 6 7 8 9 10 11 12 13 |
/* Save two different pieces of data to one file */ ES2.Save("myObjectName", "file.txt?tag=nameTag"); ES2.Save(transform, "file.txt?tag=trTag"); /* Overwrite a tag with a new value */ ES2.Save("NewName", "file.txt?tag=nameTag"); /* Load our data in any order */ ES2.Load<Transform>("file.txt?tag=trTag", transform); name = ES2.Load<string>("file.txt?tag=nameTag"); /* Delete all tags by deleting entire file */ ES2.Delete("file.txt"); |
JS
1 2 3 4 5 6 7 8 9 10 11 12 13 |
/* Save two different pieces of data to one file */ ES2.Save("myObjectName", "file.txt?tag=nameTag"); ES2.Save(transform, "file.txt?tag=trTag"); /* Overwrite a tag with a new value */ ES2.Save("NewName", "file.txt?tag=nameTag"); /* Load our data in any order */ ES2.Load<Transform>("file.txt?tag=trTag", transform); name = ES2.Load.<String>("file.txt?tag=nameTag"); /* Delete all tags by deleting entire file */ ES2.Delete("file.txt"); |