muharremtozan/unity-agent-skills

unity-ui-data-binding

Implementation of MVVM-style Data Binding for Unity UI Toolkit using the [CreateProperty] attribute and BindableProperty wrappers.

First seen Apr 19, 2026

Installation

$ npx skills add muharremtozan/unity-agent-skills --skill unity-ui-data-binding

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from muharremtozan/unity-agent-skills · top by installs.

npx skills add muharremtozan/unity-agent-skills

Browse all from muharremtozan/unity-agent-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 13
Default branch main
Open issues 0
Status Active

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,940 B
  • docs SUMMARY.md 159 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 54 installs

SKILL.md

Unity UI Toolkit Data Binding

Connect your game data (Model) to your interface (View) using modern high-performance data binding. This skill leverages Unity's unity.properties system to eliminate "Update" loop logic for UI updates.

Core Features

  1. BindableProperty<T>: A wrapper class that uses [CreateProperty] to expose values to the UI Toolkit binding engine.
  2. MVVM (Model-View-ViewModel): Separates raw game data from UI-formatted data using a ViewModel mediator.
  3. Reactive Synchronization: UI elements update automatically when the underlying property value changes (or is polled by the engine).
  4. C# Based Binding: Set up complex bindings programmatically without relying on the UI Builder's inspector fields.

Core Files (Max 3)

  • BindableProperty.cs.txt: Generic property wrapper for data sources.
  • BindingExample.cs.txt: Practical example showing a Coin display and Health bar bound to a ViewModel.

Usage

1. Define the ViewModel

Initialize BindableProperty fields that return formatted data from your model.

public BindableProperty<string> HealthText { get; }
HealthText = BindableProperty<string>.Bind(() => $"HP: {model.hp}/{model.maxHp}");

2. Set the Data Source

Assign your ViewModel to the dataSource property of your root VisualElement.

root.dataSource = myViewModel;

3. Establish the Binding

Use SetBinding on specific elements to link their properties (text, value, style) to paths in the ViewModel.

label.SetBinding("text", "HealthText.Value");

Key Principle

Always use one-way binding (ToTarget) for displays and two-way binding only for inputs (checkboxes, text fields). This keeps the "Source of Truth" in your Model.