DataFile.Load
Declaration#
public void Load(string filename, Action onComplete)Parameters#
| Name | Description |
|---|---|
| filename | Full path of file to load |
| onComplete | Action to invoke when load is complete |
Description#
Loads full data from a file
Usage#
Example
using NullSave.GDTK;using System.IO;using UnityEngine;
public class CodeSample : MonoBehaviour{
public void ExampleMethod() { // You can create your own DataFiles to work with DataFile target = new DataFile();
// You can load your data from file // You can invoke an action when save is completed target.Load(Path.Combine(Application.persistentDataPath, "demoFile.sav"), DataFileLoadComplete);
var result1 = target.GetVector3("customSection1", "vector3", Vector3.zero); var result2 = target.GetString("customSection1a", "string", string.Empty); }
private void DataFileLoadComplete() { Debug.Log("SaveSystem: DataFile loaded"); }
}