using System.Collections.Generic; using uiwidgets; using Unity.UIWidgets.engine; using Unity.UIWidgets.material; using Unity.UIWidgets.rendering; using Unity.UIWidgets.widgets; namespace UIWidgetsSample.RaycastableScene { public class ItemPickerMainUIPanel : UIWidgetsRaycastablePanel { protected override void onEnable() { AddFont("Material Icons", new List {"MaterialIcons-Regular.ttf"}, new List {0}); } protected override void main() { ui_.runApp(new ItemPickerMainUI()); } } public class ItemPickerMainUI : StatelessWidget { public override Widget build(BuildContext context) { return new MaterialApp( home: new Scaffold( backgroundColor: Colors.blue.withAlpha(64), body: new ItemPickerMainWidget() ) ); } } public class ItemPickerMainWidget : StatefulWidget { public override State createState() { return new ItemPickerMainWidgetState(); } } public class ItemPickerMainWidgetState : State { public override Widget build(BuildContext context) { return new Column( children: new List { buildTop(), buildMiddle(), this.buildBottom(), } ); } private Widget buildTop() { return new RaycastableContainer(child: new SceneBoard()); } private Widget buildBottom() { return new RaycastableContainer(new Container(height: 5f, color: Colors.grey)); } private Widget buildMiddle() { return new Expanded(child: new Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: new List { buildLeft(), buildRight(), } )); } private Widget buildRight() { return new RaycastableContainer(child: new Container(width: 100f, color: Colors.grey.withAlpha(125), child: new RightUIPanel())); } private Widget buildLeft() { return new RaycastableContainer(child: new Container(width: 100f, color: Colors.grey.withAlpha(125), child: new LeftUIPanel( itemNames: GameObjectManager.listItems, itemCheckCallback: (index, active) => { //TODO: callback when item is activated/inactivated }, itemSelectCallback: (index) => { //TODO: callback when item is selected } ))); } } }