Input Binding Persistence Generator
Plan how to save, load, and reset rebinding overrides.
How it works
Your choices shape storage keys, reset behavior, and a minimal C# pattern using SaveBindingOverridesAsJson / LoadBindingOverridesFromJson. Pair with conflict checker before shipping presets.
// Starter pattern (Input System) — adapt namespaces
using UnityEngine;
using UnityEngine.InputSystem;
public static class BindingPersistence
{
const string Key = "bindings_v1_overrides";
public static void SaveOverrides(InputActionAsset asset)
{
var json = asset.SaveBindingOverridesAsJson();
System.IO.File.WriteAllText(System.IO.Path.Combine(Application.persistentDataPath, "bindings.json"), json);
}
public static void LoadOverrides(InputActionAsset asset)
{
var path = System.IO.Path.Combine(Application.persistentDataPath, "bindings.json"); var json = System.IO.File.Exists(path) ? System.IO.File.ReadAllText(path) : "";
if (!string.IsNullOrEmpty(json))
asset.LoadBindingOverridesFromJson(json);
}
public static void ResetToDefaults(InputActionAsset asset)
{
asset.LoadBindingOverridesFromJson(null);
var path = System.IO.Path.Combine(Application.persistentDataPath, "bindings.json"); if (System.IO.File.Exists(path)) System.IO.File.Delete(path);
}
}FAQ
- Will this compile in my project?
- Snippets are templates — adjust namespaces, asset references, and error handling for your game.
- Why avoid binding indices?
- Reordering bindings in the editor changes indices; stable IDs or paths survive asset edits better.
Related tools
-
Input Rebinding Conflict Checker
Parse Unity Input Actions JSON (or a manual matrix) for duplicate paths, collisions, and gaps.
-
Controller Glyph Mapper & Prompt Previewer
Map actions to Xbox / PlayStation / Switch / generic glyphs; export CSV / JSON prompt keys.
-
Steam Input IGA / VDF Builder
Define action sets and digital/analog actions → starter VDF-style KeyValues + naming checklist.
-
Input Hot-Swap State Tester
Model keyboard ↔ gamepad switching, debounce, disconnect — state notes and Mermaid diagram export.
-
Steam Deck UX & Readiness Checker
Questionnaire against Deck guidance: readability, launcher, gamepad-first, resolution — scored report.
-
Steam Capsule Validator
Generate Steamworks-sized PNGs from one master image, ZIP export, safe-area inspector, and policy reminders.