Paths
In Easy Save, a path points to a particular piece of data. For example, we might use a path to tell Easy Save where to save something, or where to load something from.
We can also add Parameters to the end of paths to specifying settings.
Key
A key identifies a single piece of data, and is used in the same way as keys in PlayerPrefs.
C#
1 |
ES2.Save(data, "myKey"); |
JS
1 |
ES2.Save(data, "myKey"); |
File
This specifies a file, which you can save a single piece of data to, or multiple pieces of data using Tags.
If you just specify a filename, it will save that file relative to Easy Save’s default save location.
You may also specify an absolute path, which must begin with either a Windows drive letter (C:/) or a slash (/ or \).
C#
1 2 3 4 |
// Relative file ES2.Save(data, "myFile.txt"); // Absolute file ES2.Save(data, "C:/Users/User/myFile.txt"); |
JS
1 2 3 4 |
// Relative file ES2.Save(data, "myFile.txt"); // Absolute file ES2.Save(data, "C:/Users/User/myFile.txt"); |
Folder
This specifies a folder, in which you can save data. You can have relative or absolute folders, in the same way you can relative and absolute files.
A folder path must end with a slash (/ or \).
C#
1 2 3 4 |
// Relative folder ES2.Exists("myFolder/anotherFolder/"); // Absolute folder ES2.Exists("C:/Users/User/myFolder"); |
JS
1 2 3 4 |
// Relative folder ES2.Exists("myFolder/anotherFolder/"); // Absolute folder ES2.Exists("C:/Users/User/myFolder"); |
URL
A URL is used when saving and loading from web using ES2Web.
A URL path must begin with https:// or https://.
C#
1 |
ES2Web</code> <code class="csharp plain">web = </code><code class="csharp keyword">new</code> <code class="csharp keyword">ES2Web</code><code class="csharp plain">(</code><code class="csharp string">"<a href="https://www.site.com/">https://www.site.com</a>"</code><code class="csharp plain">); |
JS
1 |
ES2Web</code> <code class="csharp plain">web = </code><code class="csharp keyword">new</code> <code class="csharp keyword">ES2Web</code><code class="csharp plain">(</code><code class="csharp string">"<a href="https://www.site.com/">https://www.site.com</a>"</code><code class="csharp plain">); |