Skip to main content

DataFile.Clear

Declaration#

public virtual void Clear()

Description#

Clears data from all sections

Usage#

Example
using NullSave.GDTK;using UnityEngine;
public class CodeSample : MonoBehaviour{
    public void ExampleMethod()    {        // You can create your own DataFiles to work with        DataFile target = new DataFile();
        // Values in a custom DataFile are never saved/loaded by the system        // They can be saved/loaded manually        target.SetVector3("customSection1", "vector3", new Vector3(1.2f, 3.4f, 5.6f));
        // You can clear the entire DataFile with a single call        target.Clear();    }
}

Declaration#

public virtual void Clear(string section)

Parameters#

NameDescription
sectionSection to unload

Description#

Clears data from a specified section

Usage#

Example
using NullSave.GDTK;using UnityEngine;
public class CodeSample : MonoBehaviour{
    public void ExampleMethod()    {        // You can create your own DataFiles to work with        DataFile target = new DataFile();
        // Values in a custom DataFile are never saved/loaded by the system        // They can be saved/loaded manually        target.SetVector3("customSection1", "vector3", new Vector3(1.2f, 3.4f, 5.6f));        target.SetString("customSection1a", "string", gameObject.name);
        // You can clear a single seciton by passing its name        target.Clear("customSection1");    }
}