SaveData

SaveData#

NAMESPACE:

UnityUtils.ScriptUtils.SaveSystem

The SaveData is used in turn with other save systems. SaveData Is inherited from files that hold save data for other scripts.

Warning

Any script inheriting SaveData must include [System.Serializable] above the class declaration.

Example Usage#

using UnityEngine;
using UnityUtils.ScriptUtils.SaveSystem;

[System.Serializable]
public class PlayerData : SaveData
{
     public float health;
     public string name;
}

Functions#

UnityUtils.ScriptUtils.SaveSystem.SaveData

Implimenting this class means you must have “[System.Serializable]” above your class name.

Subclassed by UnityUtils.ScriptUtils.SaveSystem.SaveSlotSaveData

Public Functions

void SetData(string saveFileName)#

Set data variables for the save data.

Parameters:

saveFileName – File name to set to

void Save()#

Any actions to preform when saving.

void Load()#

Any actions to preform when loading.

Public Members

string saveFileName#

Save file name to write files to.

SaveSlot saveSlot#

The save slot this data belongs to.