unity-observer-pattern

Convert Unity variables into reactive properties with observable change notifications.

Updated Feb 13, 2026
One-click install
npx skills add https://github.com/MuharremTozan/Ohm-Yura --skill unity-observer-pattern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-observer-pattern
Source: https://github.com/MuharremTozan/Ohm-Yura/tree/main/.agents/skills/unity-observer-pattern
Command: npx skills add https://github.com/MuharremTozan/Ohm-Yura --skill unity-observer-pattern

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

Unity UI and gameplay logic often suffer from tight coupling between data and presentation, making it hard to reuse state and wire up UI. The unity-observer-pattern skill introduces a Reactive Property system that turns ordinary fields into Observable<T> data points with UnityEvent support, enabling clean data flow and responsive interfaces.

Core Features & Use Cases

  • Hybrid Path: supports both in-code listeners and inspector-bound UnityEvent bindings.
  • Implicit Casting: lets you treat Observable<T> as the underlying T for concise syntax.
  • Editor Persistence: automatically wires persistent calls in Edit Mode to maintain bindings across scenes.
  • Diagnostic & Tooling: built-in logging and optional editor tools for managing listeners.

Quick Start

Create an Observable<T> field and bind its OnValueChanged to a UI method or respond in code.

Frequently Asked Questions about unity-observer-pattern

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create reactive properties in Unity to automatically update UI when variables change?

Reactive properties in Unity are created by wrapping variables in a generic Observable<T> wrapper that automatically notifies listeners on change. This enables decoupled UI data binding and event-driven behavior without manual refresh calls.

Can I bind UnityEvents to reactive properties directly in the inspector?

Yes, the Observable<T> wrapper supports inspector-bound UnityEvent bindings. This hybrid path allows designers to wire up OnValueChanged events directly in the Unity inspector while maintaining editor persistence across scenes.

What is the best way to decouple gameplay logic from UI presentation in Unity?

Using a reactive property system is the best way to decouple Unity gameplay logic from UI presentation. It turns ordinary fields into Observable<T> data points with UnityEvent support, enabling clean data flow and responsive interfaces without tight coupling.

Does this reactive property system support implicit casting in Unity scripts?

Yes, the reactive property system supports implicit casting, letting you treat Observable<T> as the underlying T type. This provides concise syntax in your Unity scripts while maintaining the automatic notification behavior on value changes.

How do I manage listeners for observable variables in Unity editor tooling?

You can manage listeners using built-in diagnostic logging and optional editor tools provided by the system. These tools help track and configure OnValueChanged bindings on Observable<T> fields during edit-time and runtime.

Why do my Unity inspector bindings disappear when switching scenes?

Inspector bindings often disappear without editor persistence, but this system automatically wires persistent calls in Edit Mode. This maintains your UnityEvent bindings across scenes, preventing lost UI connections during scene transitions.