Skip to content

muhammadIdhamMaarif/Unity-Settings-Modifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity-Settings-Modifier

A complete, hot-applying Settings system for Unity 6000.2.3f1 (URP) on PC + Consoles

Unity Version Pipeline UI Input Persistence Inspector Platforms

📦 This repository contains the full implementation from a 16-part production tutorial (Parts 0–15). It delivers a polished, AAA-style Settings menu with hot-apply, presets, ES3 persistence, full rebinding, localization, accessibility, and controller glyphs.


Table of Contents


What is this?

Unity-Settings-Modifier is a complete, modular Settings framework for Unity 6000.2.3f1 (URP). It’s designed for teams shipping on PC (Windows/macOS/Linux) and Consoles. You get:

  • Hot-apply changes mid-game (no scene reload where possible).
  • Strong UX with uGUI, keyboard/mouse & gamepad navigation, tooltips, and safe fallbacks.
  • Robust persistence using Easy Save 3 (ES3).
  • Clean, maintainable C# (namespaces, asmdefs, comments, no per-frame allocations).
  • Quality presets (Low/Medium/High/Ultra + Custom) & an optional PC Auto-Detect.
  • Full Input rebinding (conflict detection), controller glyphs, localization, accessibility, and more.

Feature Matrix (Parts 0–15)

Part Topic Highlights
0 Foundations & Architecture SettingsRuntime, SettingsRegistry, SettingsModel (SO) & SettingsState (POCO), Apply/Cancel/Defaults, ES3 persistence, event bus, presets.
1 Display & Windowing Resolution list, fullscreen/borderless/windowed, refresh rate, VSync, FPS cap, safe console fallbacks.
2 URP Rendering Core MSAA, HDR, Dynamic Resolution, SRP Batcher toggles; per-camera overrides where appropriate.
3 Anti-Aliasing FXAA / SMAA / TAA per preset, motion vectors & sharpening notes, camera wiring.
4 Post-Processing Bloom, Motion Blur, Depth of Field, Color Grading; Volume profile binding vs parameter toggles.
5 Shadows Distance, cascades, resolution, soft shadows, realtime/baked flags; console guidelines.
6 Textures & Filtering Global texture quality (mip limit), anisotropic filtering, mip bias & memory notes.
7 Lighting & Probes Ambient modes, reflection probes, additional lights per object, light cookies tradeoffs.
8 Performance Switches LOD bias, skin/shadow update, occlusion culling toggle; frame pacing tips.
9 Audio Mix & Devices Master/Music/SFX/Voice sliders & mute, AudioMixer mapping, device hint (PC), OS panel helper.
10 Voice (Mic) Mic device selection (PC), input gain, noise gate threshold, Push-to-Talk, monitor meter, netcode hook.
11 Input & Keybinding Full rebinding UI, conflict detection, mouse sens/invert, gamepad dead-zones, multiple schemes.
12 Controller Icons Auto-swap Xbox/PlayStation glyphs; glyph provider and prompt prefab; manual override.
13 Localization & Language Unity Localization, language dropdown, per-language fonts (no fallback), persistence.
14 Accessibility & UI Scale Subtitles (size/bg), color-blind filter (URP feature), UI scale, controller vibration.
15 Presets & Auto-Detect Cohesive preset application, PC hardware Auto-Detect, final polish & QA.

Requirements & Dependencies

  • Unity: 6000.2.3f1
  • Render Pipeline: URP
  • UI: uGUI (Canvas/RectTransform)
  • Input: New Input System (PlayerInput / InputActionAsset)
  • Persistence: Easy Save 3 (ES3) — required
  • Inspector polish (optional): Odin Inspector — optional, editor-only
  • Localization: Unity Localization package
  • Audio: Unity AudioMixer (recommended)

🔗 Asset Store • Easy Save 3 – required • Odin Inspector – optional (guards via #if ODIN_INSPECTOR)


Folder & Assembly Structure

Assets/
  _Project/
    Settings/
      Core/                # Data models, services, applicators (runtime)
      UI/                  # uGUI controllers, rebind rows, preview widgets
      ControllerGlyphs/    # Glyph DB + sets (Xbox/PlayStation)
      Localization/        # Language catalog, font database/binder
      Accessibility/       # Subtitles, UI scale, color-blind URP feature
      Runtime/             # Bootstrap, PresetCoordinator, persistence glue
      Editor/              # QA helpers & menu items (Editor-only)

Assembly Definitions Create two asmdefs for faster compile & clean deps:

  • _Project.Settings.Core → references: UnityEngine.*, Unity.InputSystem, Unity.Localization, Unity.RenderPipelines.Universal.Runtime, Unity.Audio
  • _Project.Settings.UI → references Core + UnityEngine.UI

If Odin is present, add scripting define: ODIN_INSPECTOR.


Quick Start (10 minutes)

  1. Import this repository’s Assets/_Project/Settings folder into a URP project (Unity 6000.2.3f1).

  2. Install packages: New Input System, Localization; import Easy Save 3 (required); Odin (optional).

  3. Create SettingsModel asset: Create → Settings → Settings Model. Set default preset (e.g., High).

  4. Bootstrap: In your startup scene, add an empty SettingsManager GameObject with:

    • SettingsRuntime → assign your SettingsModel
    • SettingsRegistry
    • Applicators you need (Display, Rendering, Shadows, Textures, Lighting, PostFX, Performance, Audio, Voice, Input, ControllerIcons, Localization, Accessibility)
    • PresetCoordinator (recommended)
  5. URP Color-Blind (optional): Open your Renderer DataAdd Renderer FeatureColorBlindFilterFeature → assign ColorBlindFilter.shader.

  6. Audio: Create an AudioMixer with exposed params (Master, Music, SFX, Voice). Assign to AudioApplicator.

  7. Input: Ensure a PlayerInput exists and an InputActionAsset is assigned to InputApplicator.

  8. Localization: Create a LanguageCatalog & LanguageFontDatabase, add locales/fonts. Add LocalizationApplicator + FontApplier.

  9. Controller Glyphs: Create ControllerGlyphSet(s) for Xbox/PlayStation → fill key→sprite → put into ControllerGlyphDatabase. Add ControllerGlyphResolver & ControllerIconsApplicator.

  10. UI: Use the provided UI controllers (e.g., DisplayMenuController, InputKeybindsMenuController, PresetsMenuController) or wire your own:

    • On change: write to SettingsRuntime.Working, call runtime.SetDirty() and presetCoordinator.MarkCustom()
    • Buttons: Applyruntime.ApplyAll(); Cancelruntime.CancelChanges(); Defaultsruntime.LoadDefaultsIntoWorking() then apply.

You now have a working, hot-applying Settings menu with persistence.


Core Concepts

SettingsModel (SO) Authoring-time defaults for every section (Display, Rendering, Audio, …). SettingsState (POCO) The full runtime state: Saved (from ES3) and Working (edited in UI). SettingsRuntime

  • Loads ES3 → builds Saved & Working
  • Apply: validates, hot-applies via Applicators, then saves ES3
  • Cancel: discards Working → reloads Saved
  • Defaults: copies from SettingsModelWorking SettingsRegistry Central registry of all ISettingsApplicators present. ISettingsApplicator Each section implements: Apply(state), ApplyPreset(preset, state), Validate(state). Presets Low/Med/High/Ultra/Custom tracked on the state. Manual edits → Custom. Auto-Detect (PC) Heuristic (VRAM, shader level, cores) → recommended preset + “why”.

Feature Guides

Below are practical notes per module. All are hot-apply unless explicitly noted.

Display & Windowing (Part 1)

  • Resolution & Mode: Windowed / Borderless / Fullscreen.
  • Refresh Rate: uses current monitor modes.
  • VSync: Off / Every V-Blank / Every 2nd V-Blank.
  • FPS Cap: Application.targetFrameRate (0 = uncapped).
  • Console: Usually borderless/fullscreen only, resolution set by platform; use safe fallbacks.

Limitations

  • Consoles: don’t force desktop-style mode switches; keep to platform defaults.
  • Some window managers ignore certain refresh requests.

URP Rendering Core (Part 2)

  • MSAA (0/2/4/8)
  • HDR toggle
  • Dynamic Resolution (DRS) on/off
  • SRP Batcher on/off
  • Per-Camera overrides where appropriate

Notes

  • These write to URP Pipeline Asset or camera data and apply immediately.
  • If overriding per camera, ensure consistent settings for UI camera(s).

Anti-Aliasing (Part 3)

  • Post-AA: Off / FXAA / SMAA / TAA
  • Sharpening for TAA (amount)
  • Motion Vectors: ensure enabled for TAA stability.

Notes

  • Configure in your Volume or per camera.
  • TAA needs stable history; fast FOV swaps can cause ghosting.

Post-Processing (Part 4)

  • Bloom (intensity, threshold, scatter)
  • Motion Blur (intensity, clamp, quality)
  • Depth of Field (Gaussian/Bokeh; near/far ranges or f-stop/focal length)
  • Color Grading (tonemap, exposure, contrast, saturation)

Approach Bind either the Volume profile (swap profiles per preset) or drive parameters individually to keep one profile.


Shadows (Part 5)

  • Distance, Cascade count (1/2/4), Resolution, Soft shadows
  • Realtime vs Baked flags per preset
  • Additional lights shadow limits

Notes

  • Large distances & 4 cascades are costly; tune per platform.
  • Baking: settings don’t retroactively change baked data.

Textures & Filtering (Part 6)

  • Global Mip Limit (0 = full, 1 = ½, 2 = ¼ …)
  • Anisotropic: Off / Per-Texture / Forced On
  • Mip Bias and Streaming budget (MB)

Notes

  • Lower mip limit reduces VRAM and bandwidth.
  • On consoles, prefer Per-Texture anisotropy plus author-tuned import settings.

Lighting & Probes (Part 7)

  • Ambient: Skybox / Trilight / Flat; intensity/colors
  • Reflections: resolution, bounces, intensity
  • Additional lights per object & per-vertex options
  • Light cookies & atlas size

Tradeoffs Higher additional lights and cookies increase draw calls & bandwidth.


Performance Switches (Part 8)

  • LOD Bias
  • Skinned Mesh/Shadow update mode
  • Occlusion Culling toggle

Frame Pacing Prefer a stable cap with VSync or a sensible targetFrameRate for consistency.


Audio Mix & Devices (Part 9)

  • Master / Music / SFX / Voice sliders + Mute
  • AudioMixer mapping via exposed parameters
  • Output Device Hint (PC) + Open OS Sound Panel helper

Limitations

  • Unity cannot force an OS output device; we store a preference and provide a button to open the OS dialog.
  • On consoles, device selection is platform-managed.

Voice (Mic) (Part 10)

  • Mic device selection (PC) or “Default”
  • Input Gain (-20 dB … +20 dB)
  • Noise Gate Threshold (-80 dB … -20 dB)
  • Push-to-Talk toggle + binding display
  • Monitor Local (sidetone)
  • Live meter + “transmitting” indicator
  • Transport hook (IVoiceTransportSink) for your netcode/VOIP

Limitations

  • Consoles typically use platform party chat; in-engine Microphone is disabled / NOP.

Input & Keybinding (Part 11)

  • Control Schemes: Keyboard&Mouse / Gamepad / (yours)
  • Sensitivity (mouse/gamepad), Invert Y, Dead-zones
  • Interactive Rebind UI (per scheme)
  • Conflict Detection (optional toggle)
  • Save/restore overrides via JSON (ES3)

Tips

  • Use the provided Rebind Row prefab/controller.
  • Call SnapshotBindingOverridesToState() before save if you rebind outside the menu.

Controller Icons & Prompts (Part 12)

  • Auto-detect Xbox vs PlayStation
  • ControllerGlyphDatabase with ControllerGlyphSet(s)
  • GlyphImage ties an InputAction to the right icon
  • Manual override (Auto/Xbox/PlayStation)

Notes

  • Provide your sprites (256px+; sprite atlas recommended).
  • On consoles, force platform glyph style.

Localization & Language (Part 13)

  • Unity Localization integration
  • Language dropdown (codes: en, ja, zh-Hans, fr, es, de, ko by default)
  • Per-language fonts (no fallback) via LanguageFontDatabase + FontApplier
  • Use System Language on First Run (optional)

Notes

  • Mark uGUI Text with LocalizableFont for automatic font swap.
  • If using TMP, adapt the applier to TMP FontAssets.

Accessibility & UI Scale (Part 14)

  • Subtitles: enable, size (S/M/L), background opacity
  • Color-blind filters: Off / Protanopia / Deuteranopia / Tritanopia (+ strength) — URP Renderer Feature
  • UI Scale: 0.8× … 1.5× (root-level)
  • Controller Vibration: enable + global intensity

Notes

  • Accessibility values are not changed by graphic presets.
  • Color-blind filter runs After PostProcessing by default.

Presets, Auto-Detect & Polish (Part 15)

  • Quality Presets: Low / Medium / High / Ultra / Custom
  • PresetCoordinator applies a preset across all applicators in a single pass.
  • PC Auto-Detect: heuristic (VRAM, shader level, CPU cores) picks preset + “why” text.
  • Custom: any manual tweak switches preset display to Custom.

What You Can & Cannot Do

You Can

  • Hot-apply most rendering & gameplay-facing settings mid-game.
  • Persist all settings via ES3 with versioned schema and safe defaults.
  • Rebind input (per scheme) with conflict detection and save overrides.
  • Swap controller icons dynamically (device-aware) or force a style.
  • Localize UI strings and swap fonts per language without TMP.
  • Assist color-blind users with a URP render feature overlay.
  • Scale your entire UI quickly and reliably.
  • Use Apply/Cancel/Defaults UX with strong consistency.

You Cannot

  • Force the OS audio output device change from Unity. (We store a preference + open OS panel.)
  • Override platform-enforced display modes or resolution behavior on consoles.
  • Retro-modify already baked lighting/shadows; those must be re-baked.
  • Guarantee all URP toggles work in non-URP pipelines (this system targets URP).

Extend the System

Adding a new category (e.g., Gameplay):

  1. Data: Add a GameplaySection class (POCO) to Core/Sections.

  2. State: Add to SettingsState (clone/equals), and defaults to SettingsModel.

  3. Applicator: Implement GameplayApplicator : MonoBehaviour, ISettingsApplicator.

    • ApplyPreset(preset, state) sets recommended defaults per preset if relevant.
    • Validate(state) clamps ranges.
    • Apply(state) hot-applies to runtime (services/components).
  4. UI: Create a GameplayMenuController – read/write SettingsRuntime.Working.gameplay, call runtime.SetDirty() and presetCoordinator.MarkCustom().

  5. Hook: Add your applicator to the scene (SettingsManager). Done.


Testing & QA Checklist

  • Controller Navigation: Can traverse every control with gamepad; focus order is sane.
  • Hot-Apply: Tweak a slider (e.g., shadow distance) → visible immediately.
  • Apply/Cancel: Make changes → Apply persists; Cancel reverts to saved.
  • Defaults: Resets to SettingsModel and hot-applies.
  • Persistence: Relaunch → all values restored from ES3.
  • Presets: Switch Low→Ultra; then change one field → preset becomes Custom.
  • Auto-Detect (PC): Result & “why” matches expectations across hardware tiers.
  • Localization: Change language; strings & fonts update; no tofu boxes.
  • Accessibility: Color-blind filter visible; UI scale affects the entire UI; subtitles styling updates.
  • Input: Rebinds succeed; conflicts are caught; JSON overrides persist.
  • Audio: Mixer params change; mute works; OS device panel opens on button.
  • Voice (PC): Device list populates; meter responds; PTT toggles “transmitting”.

Troubleshooting

  • No effect when switching color-blind mode → Ensure ColorBlindFilterFeature is added to your Renderer Data and assigned the provided shader.
  • Controller icons don’t show → Check your ControllerGlyphDatabase is assigned to ControllerGlyphResolver, and your GlyphSet has entries for keys like buttonSouth, dpad/up, etc.
  • Bindings don’t persist → Confirm InputApplicator calls LoadBindingOverridesFromJson and that you Apply before exiting.
  • Fonts missing glyphs → Provide proper fonts per locale in LanguageFontDatabase. There is no fallback by design.
  • Console builds → Lock icon style to platform; avoid windowed mode toggles; ensure any forbidden toggles are hidden/disabled.

Contributing

PRs welcome!

  • Keep code clean (namespaces, asmdefs, comments).
  • Avoid per-frame allocations; prefer event-driven updates.
  • Guard optional dependencies (#if ODIN_INSPECTOR).
  • Update docs if you add a new section/applicator.

License

MIT License


Credits

Built for teams shipping cross-platform with Unity 6000.2.3f1 (URP). Includes production-grade patterns for presets, hot-apply, rebinding, localization, accessibility, and controller UX.


About

List of usable scripts for configuring game settings (e.g. Quality, Audio, Accessibility, Localization, etc) in Unity.

Resources

License

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors