Skip to main content

PlayerSaveData

A class in Root.Township, Alta.Utilities.

Asset holding a starting player save (prefab data, byte count and chunk versioning). The server's InitialPlayerInventory setting picks one by name.

Constructors​

MemberWhat it is
PlayerSaveData()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

3 private and internal fields
MemberWhat it is
private int initialSetupBytesLength in bytes of the stored setup data.
private uint[] initialSetupDataThe stored prefab data for the starting player.
private uint[] versioningChunk versioning the data was saved with.

Methods​

MemberWhat it is
static PlayerSaveData GetCurrent()The asset named after the server's InitialPlayerInventory setting, or null when the setting is None or no server is running.
void Populate(PlayerSave save)Copies the stored prefab data, byte count and versioning into a player save.
protected override void OnValidate()Only calls the base.