-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleCounterApp.cs
More file actions
31 lines (29 loc) · 893 Bytes
/
Copy pathSimpleCounterApp.cs
File metadata and controls
31 lines (29 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using UniMob;
using UniMob.UI;
using UniMob.UI.Widgets;
using UnityEngine;
namespace Samples.HelloWorld
{
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,
}
}
};
}
}
}