Save Slots

Save Slots let players maintain multiple independent save states — each with its own title, summary, play time, creation date, and optional screenshot thumbnail. They are managed by the SaveSlotManager, accessible via wagSave.SaveSlots.


Enabling Save Slots

In the WagSave editor window, navigate to Save Slots and enable the Enable Save Slots toggle. From there you configure:

  • List Type — Static or Dynamic (see below)
  • Capacity — Maximum number of slots (1–500, or unlimited for Dynamic lists)
  • Overwrite at Capacity — Automatically overwrites the oldest slot when full
  • Use Save Slot UI — Shows the built-in slot picker UI on save/load
  • Include Screenshot Thumbnail — Captures a screenshot per slot

List Types

Static

A fixed array of slots is pre-created. Players overwrite or delete existing slots rather than creating new ones. Good for classic "slot 1, slot 2, slot 3" save menus.

Dynamic

Slots are created on demand. New saves always add a new slot up to the capacity limit. Set capacity to 0 (Infinite) for an unlimited list. Good for games where the player saves frequently with a history of states.


Built-in Slot UI

When Use Save Slot UI is enabled, calling wagSave.Save() or wagSave.Load() without a slot argument automatically shows the built-in slot picker UI. The player selects or confirms a slot and the operation proceeds.

To bypass the UI and control slot selection in code, pass a slot directly:

SaveSlot slot = wagSave.SaveSlots.AddNewSlot(SaveSlotType.Manual);
await wagSave.SaveAsync(slot);

Working with Slots in Code

using WaggleBum.WagSave;
using WaggleBum.WagSave.Core.SaveSlots;
using WaggleBum.WagSave.Core.Enums;

WagSave wagSave = WagSave.GetInstance();
SaveSlotManager slotManager = wagSave.SaveSlots;

Creating a slot and saving into it

// Create a new Manual slot
SaveSlot slot = slotManager.AddNewSlot(SaveSlotType.Manual);
slot.Title   = "Chapter 2";
slot.Summary = "Just reached the forest";

await wagSave.SaveAsync(slot);

Loading from a slot

// Get the most recently modified slot
SaveSlot latest = slotManager.GetLatestSlot();
if (latest != null)
{
    await wagSave.LoadAsync(latest);
}

Overwriting a slot

// Overwrite the slot at index 0 with a Manual save
SaveSlot slot = slotManager.OverwriteSlot(SaveSlotType.Manual, atIndex: 0);
await wagSave.SaveAsync(slot);

Deleting a slot

slotManager.DeleteSlot(slot);

Iterating all slots

foreach (SaveSlot slot in slotManager.Slots)
{
    if (!slot.IsEmpty)
    {
        Debug.Log($"[{slot.SlotNumber}] {slot.Title} — {slot.TotalPlaySeconds}s played");
    }
}

SaveSlot Properties

PropertyTypeDescription
IdstringStable GUID for this slot.
SlotNumberintDisplay number shown in UI.
TitlestringPlayer-visible save name. Set before calling Save.
SummarystringShort description of the save state.
TypeSaveSlotTypeManual, Quick, Auto, or Temporary.
TotalPlaySecondsintAccumulated play time in seconds.
CreatedDateTimeWhen the slot was first created.
ModifiedDateTimeWhen the slot was last written to.
IsEmptyboolTrue when no save data has been written to this slot.

SaveSlotManager Properties and Events

MemberTypeDescription
SlotsSaveSlot[]All slots, including empty placeholders.
CountintNumber of non-empty, non-temporary slots.
CapacityintMaximum slot count. 0 means unlimited.
IsAtCapacityboolTrue when no more slots can be created.
OnSlotListChangedeventRaised when a slot is added, removed, or updated.
slotManager.OnSlotListChanged += () =>
{
    // Refresh your save menu UI here
    RefreshSlotUI(slotManager.Slots);
};

Slot Types

TypeDescription
ManualPlayer-initiated save. Typical for menu-driven saves.
QuickFast save triggered by a key press or the WagSaveTrigger component.
AutoWritten by the autosave system.
TemporaryTransient slot excluded from the persistent slot list. Useful for checkpoints.

Getting the Slot for a Specific Operation

WagSave provides helpers to get the correct slot for saving or loading without managing selection logic yourself:

// Get or create the appropriate slot for saving (respects capacity and overwrite settings)
SaveSlot saveSlot = wagSave.GetSaveSlotForSaving();
SaveSlot quickSlot = wagSave.GetSaveSlotForSaving(SaveSlotType.Quick);

// Get the most appropriate slot for loading
SaveSlot loadSlot = wagSave.GetSaveSlotForLoading();