Skip to main content

SaveTarget.Load

Declaration#

public virtual void Load(Stream stream, bool skipRecreate)

Parameters#

NameDescription
streamStream to use
skipRecreateSkip reading recreate data

Description#

Load object data

Usage#

Example
using NullSave.GDTK;using System.IO;using UnityEngine;using UnityEngine.SceneManagement;
public class CodeSample : MonoBehaviour{
    public void ExampleMethod(SaveTarget target)    {        // Save targest are saved under their own sections, named as below        string section = "__SceneData__" + SceneManager.GetActiveScene().name;
        // The key is the targets saveId        byte[] b = SaveSystem.GetBinary(section, target.saveId, null);
        // Target can be reloaded from stream        if (b != null && b.Length > 0)        {            using (MemoryStream ms = new MemoryStream(b))            {                target.Load(ms);            }        }    }
}

Declaration#

public virtual void Load()

Description#

Load object data

Usage#

Example
using NullSave.GDTK;using UnityEngine;
public class CodeSample : MonoBehaviour{
    public void ExampleMethod(SaveTarget target)    {        // Target can be loaded directly as long as it's related section has been loaded        target.Load();    }
}