Code-based GUI library for development menus for Unity
public class ExampleSimple : MonoBehaviour
{
public string stringValue;
public float floatValue;
public int intValue;
public Color colorValue;
void Start()
{
var root = GetComponent<RosettaUIRoot>();
root.Build(CreateElement());
}
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)
)
);
}
} |
This package uses the scoped registry feature to resolve package dependencies.
Edit > ProjectSettings... > Package Manager > Scoped Registries
Enter the following and click the Save button.
"name": "fuqunaga",
"url": "https://registry.npmjs.com",
"scopes": [ "ga.fuquna" ]
Window > Package Manager
Select MyRegistries
in Packages:
Select RosettaUI - UI ToolKit
and click the Install button
- Put
Packages/RosettaUI - UIToolkit/RosettaUIRootUIToolkit.prefab
in the Hierarychy - Write code to generate
Element
instance - Call
RosettaUIRoot.Build(Element)
to generate the actual UI ( Example )
Examples are available in this repository. I recommend downloading and checking it out.
Please check the Examples