EngineUnity 2022.3 LTS or newer
LanguageC#
Time to run~4 minutes
LevelBeginner — comfortable with C# classes and SerializeField
OutputOne static class + one example SaveData struct, ~80 lines
DependenciesNone. PlayerPrefs and JsonUtility are built in.

The prompt

Open claude.ai/new, paste, and send.

$ Build me a SaveSystem for Unity 2022.3+ that persists a SaveData class to PlayerPrefs as JSON.

// shape
- A static class SaveSystem with: Save(SaveData data), Load() → SaveData, Has() → bool, Delete().
- A serializable SaveData class with example fields: int level, float playtime, string lastScene, int version.
- Use JsonUtility.ToJson and FromJson. Store under PlayerPrefs key "save_v1".

// behavior
- Load() returns a default SaveData if no key exists or JSON parse fails.
- Save() always sets data.version to the current SCHEMA_VERSION constant before serializing.
- A private Migrate(SaveData old) method handles version mismatches: returns a new SaveData with old fields copied where compatible, defaults elsewhere.
- Logs a warning (not an exception) if migration is needed.

// constraints
- No try/catch swallowing all exceptions. Catch JsonException specifically.
- No async / coroutines. Saves are synchronous, small, and rare.

// return format
- One file, named SaveSystem.cs.
- Include the SaveData class in the same file.
- No prose before or after the code.
Open in Claude ▸ Run · 4 min

What this gets you

The version-migration piece is the part that usually gets skipped in tutorials, and it's the part that breaks players' saves a year later when you add a new field. This prompt builds it in from the start, so adding a new SaveData field never costs anyone their progress.

Quick checklist

Full breakdown coming soon

This page is the prompt itself plus a minimal checklist. The deeper writeup with worked examples, common gotchas, and how to extend with binary encryption is on the roadmap. Bookmark this page or check back on the blog as it ships.