GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - EggyStudio/Unity.Systems.Serializer: Shared JSON serialization + atomic file IO + a small envelope format used by SettingsProfile and SettingsDefinition.

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
Runtime
Runtime
 
 
LICENSE.txt
LICENSE.txt
 
 
LICENSE.txt.meta
LICENSE.txt.meta
 
 
README.md
README.md
 
 
README.md.meta
README.md.meta
 
 
Runtime.meta
Runtime.meta
 
 
package.json
package.json
 
 
package.json.meta
package.json.meta
 
 

Repository files navigation

Unity Essentials

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;

Installation

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

Serializer

Quick overview: Shared JSON serialization + atomic file IO + a small envelope format used by SettingsProfile and SettingsDefinition.

This package is the shared foundation for JSON persistence across UnityEssentials. It intentionally stays small and predictable:

  • Json.NET (Newtonsoft.Json) with a shared JsonSerializerSettings (indentation + converters)
  • Atomic file writes via a temp file + replace/move
  • A shared envelope (SerializerEnvelope<T>) with metadata (Type, Name, SchemaVersion, UpdatedUtc) and a Values payload
  • Small helpers for common path and formatting tasks

Main APIs

SerializerJson

Central place for Json.NET settings and helpers.

  • SerializerJson.Serialize(value)
  • SerializerJson.Deserialize<T>(json)

SerializerEnvelope<T>

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": { }
}

SerializerJsonStore

Tiny IO layer:

  • Exists(path)
  • ReadAllText(path)
  • WriteAllTextAtomic(path, content)
  • Delete(path)

SerializerUtility

Common helpers:

  • GetPath<T>(fileName, extension: "json") → writes into a Resources folder next to the project
  • Sanitize(fileName)
  • GetLastSegment("Controls/Mouse/Sensitivity") → Sensitivity
  • GetGroupPath("Controls/Mouse/Sensitivity") → Controls/Mouse
  • LabelizePathSegment("MasterVolume") → Master Volume

Usage in other packages

Settings values: SettingsProfile

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();

Settings metadata: SettingsDefinition

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();

Notes

  • The serializer uses Newtonsoft.Json, not UnityEngine.JsonUtility.
  • File paths are generated by SerializerUtility.GetPath<T>() (currently under a Resources folder next to the project).
  • The envelope exists to allow forward-compatible metadata (SchemaVersion, timestamps, etc.) without changing payload types.

Files in This Package

  • Runtime/SerializerJson.cs – Json.NET settings + serialize/deserialize helpers
  • Runtime/SerializerEnvelope.cs – shared envelope format
  • Runtime/SerializerJsonStore.cs – atomic read/write/delete
  • Runtime/SerializerUtility.cs – small path + label helpers

Tags

unity, json, serialization, newtonsoft, persistence, settings

About

Shared JSON serialization + atomic file IO + a small envelope format used by SettingsProfile and SettingsDefinition.

Resources

Readme
MPL-2.0 license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.