Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 1.71 KB

README.md

File metadata and controls

55 lines (41 loc) · 1.71 KB

UniMob.UI · Github license Unity 2019.3 GitHub package.json version

A declarative library for building reactive user interface

A quick example

So what does code that uses UniMob.UI look like?

using UniMob;
using UniMob.UI;
using UniMob.UI.Widgets;
using UnityEngine;

public class SimpleCounterApp : UniMobUIApp
{
    [Atom] private int Counter { get; set; } = 0;

    protected override Widget Build(BuildContext context)
    {
        return new Container
        {
            BackgroundColor = Color.cyan,
            Child = new UniMobButton
            {
                OnClick = () => Counter += 1,
                Child = new UniMobText(WidgetSize.Fixed(400, 100))
                {
                    Value = "Tap count: " + Counter,
                    FontSize = 40,
                    MainAxisAlignment = MainAxisAlignment.Center,
                    CrossAxisAlignment = CrossAxisAlignment.Center,
                }
            }
        };
    }
}

How to Install

Minimal Unity Version is 2019.3.

Library distributed as git package (How to install package from git URL)
Git URL (UniMob.UI): https://github.com/codewriter-packages/UniMob.UI.git
Git URL (UniMob): https://github.com/codewriter-packages/UniMob.git

License

UniMob.UI is MIT licensed.

Credits

UniMob.UI inspired by Flutter.