This module is part of the Unity Essentials ecosystem and follows the same lightweight, editor-first approach. Unity Essentials is a lightweight, modular set of editor utilities and helpers that streamline Unity development. It focuses on clean, dependency-free tools that work well together.
All utilities are under the UnityEssentials namespace.
using UnityEssentials;
Install the Unity Essentials entry package via Unity's Package Manager, then install modules from the Tools menu.
-
Add the entry package (via Git URL)
- Window → Package Manager
- "+" → "Add package from git URL…"
- Paste:
https://github.com/EggyStudio/UnityEssentials.git
-
Install or update Unity Essentials packages
- Tools → Install & Update UnityEssentials
- Install all or select individual modules; run again anytime to update
Quick overview: Shared JSON serialization + atomic file IO + a small envelope format used by
SettingsProfileandSettingsDefinition.
This package is the shared foundation for JSON persistence across UnityEssentials. It intentionally stays small and predictable:
- Json.NET (
Newtonsoft.Json) with a sharedJsonSerializerSettings(indentation + converters) - Atomic file writes via a temp file + replace/move
- A shared envelope (
SerializerEnvelope<T>) with metadata (Type,Name,SchemaVersion,UpdatedUtc) and aValuespayload - Small helpers for common path and formatting tasks
Central place for Json.NET settings and helpers.
SerializerJson.Serialize(value)SerializerJson.Deserialize<T>(json)
A lightweight metadata wrapper used when SettingsProfile / SettingsDefinition save to disk.
{
"Type": "SettingsProfileBase",
"Name": "Default",
"SchemaVersion": 0,
"UpdatedUtc": "2026-01-22T12:34:56.789Z",
"Values": { }
}Tiny IO layer:
Exists(path)ReadAllText(path)WriteAllTextAtomic(path, content)Delete(path)
Common helpers:
GetPath<T>(fileName, extension: "json")→ writes into aResourcesfolder next to the projectSanitize(fileName)GetLastSegment("Controls/Mouse/Sensitivity")→SensitivityGetGroupPath("Controls/Mouse/Sensitivity")→Controls/MouseLabelizePathSegment("MasterVolume")→Master Volume
SettingsProfile<T> is a JSON-backed container that uses this serializer to persist its payload.
// Example: raw key/value store var profile = SettingsProfile.GetOrCreate("Default"); profile.GetValue()["Audio/MasterVolume"] = 0.8f; profile.SaveIfDirty();
SettingsDefinition is implemented as a specialized SettingsProfile<SettingsDefinitionBase>.
It stores metadata (SettingsMetaData) keyed by a reference path.
var definition = SettingsDefinition.GetOrCreate("Settings"); definition .SetSlider("Controls/Mouse/Sensitivity", min: 0, max: 100, step: 5) .SetOrder(10) .SetTooltip("Set mouse sensitivity"); definition .SetOptions("Controls/Input", new[] { "Gamepad", "Keyboard" }) .SetOrder(9) .SetTooltip("Select preferred input"); definition.SaveIfDirty();
- The serializer uses Newtonsoft.Json, not
UnityEngine.JsonUtility. - File paths are generated by
SerializerUtility.GetPath<T>()(currently under aResourcesfolder next to the project). - The envelope exists to allow forward-compatible metadata (
SchemaVersion, timestamps, etc.) without changing payload types.
Runtime/SerializerJson.cs– Json.NET settings + serialize/deserialize helpersRuntime/SerializerEnvelope.cs– shared envelope formatRuntime/SerializerJsonStore.cs– atomic read/write/deleteRuntime/SerializerUtility.cs– small path + label helpers
unity, json, serialization, newtonsoft, persistence, settings