unity-ui-data-binding
Implementation of MVVM-style Data Binding for Unity UI Toolkit using the [CreateProperty] attribute and BindableProperty wrappers.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Implementation of MVVM-style Data Binding for Unity UI Toolkit using the [CreateProperty] attribute and BindableProperty wrappers.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Factory pattern for creating families of related objects. Supports both ScriptableObject composition and simple prefab instantiation.
Manage project boundaries using Assembly Definitions (.asmdef) for faster compile times and modular architecture. Based on the patterns by Adam Myhre. Enforces responsibility-based organization and handles Runtime/Editor/Tests splits.
Step-by-step object construction using fluent interfaces. Simplifies complex GameObject setup.
Professional Unity C# Code Reviewer. Detects anti-patterns, performance leaks, and enforces project-specific architecture.
Encapsulate actions as objects for queuing, undo/redo, and async execution.
Implements "Composition over Inheritance" using ScriptableObject configs and C# Tuples. Replaces deep class hierarchies with modular, has-a relationships.
| name | unity-ui-data-binding |
| description | Implementation of MVVM-style Data Binding for Unity UI Toolkit using the [CreateProperty] attribute and BindableProperty wrappers. |
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.
[CreateProperty] to expose values to the UI Toolkit binding engine.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.Initialize BindableProperty fields that return formatted data from your model.
public BindableProperty<string> HealthText { get; }
HealthText = BindableProperty<string>.Bind(() => $"HP: {model.hp}/{model.maxHp}");
Assign your ViewModel to the dataSource property of your root VisualElement.
root.dataSource = myViewModel;
Use SetBinding on specific elements to link their properties (text, value, style) to paths in the ViewModel.
label.SetBinding("text", "HealthText.Value");
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.