-
-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathExampleSimple.cs
More file actions
36 lines (32 loc) · 964 Bytes
/
Copy pathExampleSimple.cs
File metadata and controls
36 lines (32 loc) · 964 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
32
33
34
35
36
using UnityEngine;
namespace RosettaUI.Example
{
[RequireComponent(typeof(RosettaUIRoot))]
public class ExampleSimple : MonoBehaviour
{
public string stringValue;
public float floatValue;
public int intValue;
public Color colorValue;
private void Start()
{
var root = GetComponent<RosettaUIRoot>();
root.Build(CreateElement());
}
private Element CreateElement()
{
return UI.Window(nameof(ExampleSimple),
UI.Page(
UI.Field(() => stringValue),
UI.Slider(() => floatValue),
UI.Row(
UI.Field(() => intValue),
UI.Button("+", () => intValue++),
UI.Button("-", () => intValue--)
),
UI.Field(() => colorValue)
)
);
}
}
}