Minimalist UI data binding framework for Unity.
You can install Fasten Up using any of the following methods:
https://github.com/merlinds/fasten-up.git?path=/Assets/FastenUp#v0.1.0
- In Unity, open Window → Package Manager.
- Press the + button, choose "Add package from git URL..."
- Enter url above and press Add.
openupm install com.merlinds.fasten-up
- Download the .unitypackage from releases page.
- Import FastenUp.X.X.X.unitypackage
- TextMeshPro - for
Text
components binding.
Mediator class is a bridge between the game data and the UI components.
Create a mediator class that inherits from IMediator
interface, like this:
using FastenUp.Runtime.Bindables;
using FastenUp.Runtime.Mediators;
using UnityEngine;
public partial class MyMediator : MonoBehaviour, IMediator
{
public Bindable<string> Text { get; } = new();
public void Awake()
{
Text.Value = "Hello World!";
}
}
Note: The
partial
keyword must be used for the sake of the source generator.
Add the MyMediator
component to the GameObject.
Then add the TextMeshPro
component with the TextBinder
component to the child GameObject.
Now the TextMeshPro
component will be bound to the Text
property of the MyMediator
class,
and the text will be updated when the Text
property changes.
More examples can be found in the Samples~
folder.
Fasten Up is distributed under the terms of the MIT License. A complete version of the license is available in the LICENSE file in this repository. Any contribution made to this project will be licensed under the MIT License.