Player profiles
List, select, create, rename (case-only too) and delete profiles. One Profile object per profile, so a settings change is seen everywhere in the game.
One player, one profile, every Unity game.
Unity.Shared is the package every MindAttic Unity game references for player profiles, a single versioned settings.json per player, a session mute and a shared headless test mode.
What it is
Every game needs the same unglamorous layer: who is playing, what volume they like, what language they read, and a settings file that survives a crash. Unity.Shared is that layer, written once, so a player's name, colour, volumes and language look the same from game to game.
Getting the player's identity is one line: Profiles.Current.Settings.Common.DisplayName. Profiles can be listed, selected, created, renamed and deleted, and a deleted profile is moved to a trash folder rather than erased.
The file format is built to be hard to break. Writes are atomic, a damaged or hand-edited file is set aside and defaults are used instead of crashing, and fields written by a newer version of a game are kept when an older one loads and saves the same file.
The core has no engine references and builds as .NET Standard 2.1, so any game logic that reads settings can be covered by plain dotnet test, without opening Unity.
Who it's for
Features
List, select, create, rename (case-only too) and delete profiles. One Profile object per profile, so a settings change is seen everywhere in the game.
Music and SFX volume, mutes, reduce motion, language, display name and player colour, plus a free-form game block each game owns.
Atomic writes through a temp file, UTF-8 without BOM and LF line endings. A damaged file is renamed settings.json.bad-<timestamp> and loading never throws.
Unknown fields at every level are kept and written back, and a file from a newer version is still read and keeps its version number.
A small strict JSON reader and writer that keeps key order and exact number text, behind an IJsonCodec you can swap for your own.
Until a player picks one, their colour comes from an 8-colour palette chosen from the profile name, the same on every run.
-muted or MINDATTIC_CLI_MUTED=1 silences one run for tests and automation without touching the player's saved volumes.
--headless or MINDATTIC_HEADLESS=1 runs the real game muted, in the background with vSync off, and logs MINDATTIC_HEADLESS_READY <productName> for scripts to wait on.
Unity.Shared.Core is engine-free, builds with warnings as errors, and is covered by an NUnit suite of the format, the profile store and the headless switch.
How it works
Unity.Shared is a local UPM package, referenced by path from the sibling checkout.
Point com.mindattic.unity.shared at the package folder in Packages/manifest.json.
The package roots itself at Application.persistentDataPath before the first scene loads; Profiles.Current is ready.
Change any setting and call Profiles.Current.SaveSettings() for an atomic write.
Quick start
In Packages/manifest.json, with Unity.Shared cloned next to the game's repo:
The full setup guide lives in the documentation.
"com.mindattic.unity.shared": "file:../../Unity.Shared/unity/com.mindattic.unity.shared"Part of MindAttic
Unity.Shared sits under every MindAttic Unity game: GridGame.Unity, TownWalker, Unity.Cursory, Unity.Eve and the Unity.Rea games all reference it by path.
It deliberately stays small. Networking lives in Unity.Multiplayer, UI in MindAttic.Components, and Unreal games get the same headless contract from Unreal.Shared.
Status
Profiles, settings v1, the JSON codec, atomic files, the session mute and headless mode are all built and in use at version 1.1.0. What remains is a bug hunt, a compile pass across every consuming game, and release 2 with a changelog.
Current milestone: Unity.Shared 2: the stable profile, settings and headless package every game uses.
Next step
Guides, reference and design notes are in the searchable MindAttic documentation. The source, issues and history are on GitHub.