A declarative, functional GUI framework for Unity 3D. Provides data-binding and other modern features.

An example using it in Kerbal Space Program (a Unity game): Animation of UI in action


Unity’s traditional GUI system was a pain to use. It worked in an immediate mode where the developer had to track the state of controls and their contents. Affinity supports all sorts of complex layouts and binding schemes you might expect to find in a modern UI framework.

Affinity provides a fluent API to quickly lay out “markup” in the form of chained function calls. At runtime, no object creation occurs, just function calls. Databinding is all functional, no reflection anywhere.


Unity’s new in-game UI system no longer works this way, and limiting the utility of this project. However, the same APIs are used for extending the Unity editor itself, so I plan to rework it for editor use. Unity editor addons can be complex and would benefit from such a framework.

Github Project