Skip to main content

GlobalStats.DataSave

Declaration#

public virtual void DataSave(Stream stream)

Parameters#

NameDescription
streamName of file to create/update. Application.persistentDataPath is automatically prepended.

Description#

Saves data to a specified file

Usage#

Example
using NullSave.GDTK.Stats;using System.IO;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(GlobalStats target, string filename)    {        using(FileStream fs = new FileStream(filename, FileMode.Create, FileAccess.Write))        {            target.DataSave(fs);        }    }
}

Declaration#

public virtual void DataSave(string filename)

Parameters#

NameDescription
filenameName of file to create/update. Application.persistentDataPath is automatically prepended.

Description#

Saves data to a specified file

Usage#

Example
using NullSave.GDTK.Stats;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(GlobalStats source)    {        if (!source.busy)        {            source.DataSave("test.sav");        }    }
}