Skip to content

Class SaveMeta

The SaveMeta class provdes a leightweight snapshot of a savegame's information. It allows you to display details, like save date, player name or progression in your UI, without having to load the entire save file into memory.

An always up-to-date list of all available savegame metas is accessible via the SaveManager.

Properties

SaveName

The unique, internal identifier of save files on the disk, generated by Guid.

DisplayName

The friendly save name, provided when the save was created (i.e. "before boss fight")

  • Type: string
  • Note: This is the primary name you should display in your Load/Save slots UI

SaveVersion

The version of your project's data scheme at the time this file was created

  • Type: System.Version
  • Note: The version is pulled from the FlaxSaveSettings. It is vital for handling legacy save files, if your data structure changes during development.

SaveDate

The exact timestemp of when the save file was created

  • Type: System.DateTime
  • Note: Since DateTime is a raw format, you'll likely want to format it for UI, i.e. SaveDate.ToString("g"), for a readable date and time
C#
DateTime localTime = metaData.SaveDate.ToLocalTime();
string date = localTime.ToString("d");
string time =  localTime.ToString("t");

Debug.Log(date + ", " + time); // 01.01.2026, 13:27

CustomData

A custom data block for project specific metadata, that you want to show in the menu, i.e. the players skill level, current quest or the world location

IsAutoSave

A flag that indicates if this file was created with the auto-save feature or manually by the player

  • Type: bool
  • Tip: Use this to title UI slots as a localized version of "Auto-Save"

Methods

GetCustomDataAs< T >

A helper method to safely cast your CustomData object back into its original class

Returns Description
T The type you specified

How it works: Because CustomData is stored as a general object, you need to cast it to access your specific fields and variables, like PlayerLevel. This method does the type-check for you. If the data isn't the type you asked for, it returns null for classes or the default value for struct.

C#
SaveMeta newestMeta = SaveManager.Instance.SaveMetas.Last();
PlayerMeta myData = SaveMeta.GetCustomDataAs<PlayerMeta>();

if(myData != null)
    Debug.Log("Player Level is " + myData.PlayerLevel);