Skip to main content

DataFile.LoadSection

Declaration#

public void LoadSection(string filename, string section, Action onComplete)

Parameters#

NameDescription
filenameFull path of file to load
sectionName of section to load
onCompleteAction 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");    }
}