浏览代码

update readme

/main
fzhangtj 6 年前
当前提交
7c2fcdc2
共有 1 个文件被更改,包括 22 次插入8 次删除
  1. 30
      README.md

30
README.md


A UIWidgets App is written in **C# Scripts**. Please follow the steps to create an App and play it
in Unity Editor.
1. Create a new C# Script named "ExampleCanvas.cs" and paste the following codes into it.
1. Create a new C# Script named "UIWidgetsExample.cs" and paste the following codes into it.
using Unity.UIWidgets.animation;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;

namespace UIWidgetsSample {
public class ExampleCanvas : WidgetCanvas {
public class UIWidgetsExample : UIWidgetsPanel {
protected override Widget getWidget() {
return new ExampleApp();
protected override Widget createWidget() {
return new WidgetsApp(
home: new ExampleApp(),
pageRouteBuilder: this.pageRouteBuilder);
}
protected virtual PageRouteFactory pageRouteBuilder {
get {
return (RouteSettings settings, WidgetBuilder builder) =>
new PageRouteBuilder(
settings: settings,
pageBuilder: (BuildContext context, Animation<float> animation,
Animation<float> secondaryAnimation) => builder(context)
);
}
}
class ExampleApp : StatefulWidget {

new GestureDetector(
onTap: () => {
this.setState(()
=> {
=> {
this.counter++;
});
},

正在加载...
取消
保存