Walkthrough: use your own menu

Shipready's save menu can be restyled a long way (see Make it yours). If your game already has its own menu art, you can instead build the menu yourself on Shipready's public API and keep everything else: slots, autosaves, backups, pictures and world saving. This page walks through the Own Menu demo, which does exactly that in one short script.

1. Try it #

Open Samples/Demos/Scenes/OwnMenuDemo.unity and press Play. A plain list shows five slots. Click +1 coin a few times, then Save on a slot: the row shows the date, "3 coins" and a picture of the scene. Click +1 coin again, then Load: the coin count goes back to what was saved. Delete empties the slot.

Like every demo, it runs on its own settings and saves into its own folder (SaveKitDemos/OwnMenu), so it never touches your game's saves.

2. Read the script #

Samples/Demos/Scripts/OwnMenu/OwnMenuDemo.cs builds its uGUI list in code, so the whole menu is in one file. The parts that use Shipready are marked 1 to 5:

  1. List the slots. SaveKit.GetSlotInfos(list) fills a list with one SlotInfo per slot: Exists, SavedUtc, PlaytimeSeconds, Location, Summary and more. Draw one row per entry.
  2. Save. Set what the row will say, take a picture, then save: csharp SaveKit.SetSummary(coins + " coins"); Texture2D picture = ThumbnailCapture.Capture(Camera.main); SaveKit.SetNextThumbnail(picture); SaveResult result = SaveKit.Save(slot); Thumbnails.DestroyTexture(picture);
  3. Load. SaveKit.Load(slot) restores every value and Saveable; read your values back afterwards, here with SaveKit.Data.Get("coins", 0).
  4. Delete. SaveKit.Delete(slot); the save's backups and picture go with it.
  5. Show the picture. Thumbnails.Read(SaveKit.Storage, info.FileName) returns the save's picture as a texture, or null. Destroy it with Thumbnails.DestroyTexture when the row goes away.

Every call returns a result with Success and a plain-English Message, so the status line can say what happened.

3. Make it your own #

Copy the script into your project, rename it, and swap the plain boxes for your own prefabs. Things Shipready's menu does for you that you may want too:

  • Ask before overwriting, loading or deleting: check info.Exists and show your own confirmation first.
  • Autosaves and the quicksave: SaveKit.GetAutosaveInfos(list) and SaveKit.GetQuicksaveInfo(); load them with SaveKit.Load(info).
  • Damaged saves: info.IsDamaged and info.HasValidBackup; SaveKit.RestoreBackup(slot) puts the newest good backup back.
  • Saves from a newer version of the game: info.IsFromNewerVersion; do not offer Load for them.
  • Large lists: read pictures only for rows on screen, as Shipready's menu does.

The Reference lists every call.

Back to: All walkthroughs.

Something unclear or wrong? Tell us · Get help