DataFile.LoadSection
Declaration#
public void LoadSection(string filename, string section, Action onComplete)Parameters#
| Name | Description |
|---|---|
| filename | Full path of file to load |
| section | Name of section to load |
| onComplete | Action to invoke when load is complete |
Description#
Loads section 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 by individual section // You can invoke an action when save is completed target.LoadSection(Path.Combine(Application.persistentDataPath, "demoFile.sav"), "customSection1", DataFileLoadComplete);
var result1 = target.GetVector3("customSection1", "vector3", Vector3.zero); }
private void DataFileLoadComplete() { Debug.Log("SaveSystem: DataFile section loaded"); }
}