浏览代码

fix readme

/main
xingwei.zhu 5 年前
当前提交
591f0995
共有 2 个文件被更改,包括 32 次插入19 次删除
  1. 25
      README-ZH.md
  2. 26
      README.md

25
README-ZH.md


#### 七、自动调节帧率
如果要使得构建出的应用能够自动调节帧率,请打开Project Settings,将构建目标平台对应的Quality选项卡中的V Sync Count设置为Don't Sync。
默认的逻辑是在界面静止时将帧率降低为25,在界面变动时将帧率提高至60。
如果您需要修改帧率升高或降低时的行为,请将`Window.onFrameRateSpeedUp`和/或`Window.onFrameRateCoolDown`设置为您自己的函数。
默认的逻辑是在界面静止时将帧率降低,在界面变动时再将帧率提高至60。
如果您不想开启该功能,请将`Window.onFrameRateSpeedUp`和/或`Window.onFrameRateCoolDown`设置为空函数,()=> {}即可。
在Unity 2019.3版本及以上,UIWidgets将使用OnDemandRenderAPI来实现帧率调节,它将在不影响UI响应速度的情况下大幅降低耗电和发热问题。
#### 八、WebGL Canvas分辨率调整插件
因为浏览器中Canvas的宽高和其在显示器上的像素数可能不一致,所以构建出的WebGL程序中画面可能会模糊。

我们提供了一个包装好的`UnityObjectDetector`组件以及`onRelease`回调函数,借此您可以实现简单地将物体(例如Hierarchy内的场景物体、Project窗口下的文件等)拖拽至区域内,来获得`UnityEngine.Object[] `类型的引用并进行操作。
你可以在“UIWidgetsTests -> Drag&Drop”下找到简单的实例样例。
## 调试UIWidgets应用程序

## 学习
#### 示例
#### 教程
你可以在**Samples**文件夹的UIWidgets包中找到一些精心挑选的UIWidgets应用示例,并通过这些示例来开始你的学习。请随意尝试并进行修改以查看结果。
你也可以在支持**UIWidgets**的编辑器中,点击主菜单上的UIWidgets,并在下拉窗口中选择一个示例。
包括开发组在内的广大开发者为UIWidgets提供了许多可供学习的样例和教程,你可以根据你的需求进行学习:
- UIWidgets官方示例。目前所有官方使用的示例项目均维护在一个独立的Github仓库(https://github.com/UIWidgets/UIWidgetsSamples)中。你可以
将它clone到你项目本地的Assets目录下使用。
具体的,你可以在Sample项目的**Scene**子文件夹中浏览所有示例UI场景。
此外,你还可以点击主菜单上的新增的UIWidgetsTests选项卡,并在下拉菜单中选择一个EditorWindow UI示例来运行。
- UIWidgets凉鞋系列教程。你可以在凉鞋老师整理的Github仓库(https://github.com/liangxiegame/awesome-uiwidgets)中学习UIWidgets的基本用法
以及许多有趣的小Demo。
- ConnectApp开源项目。这是一个完整的线上、开源、完全基于UIWidgets的第一方App项目。其中包含了大量产品级的UIWidgets工程实践细节,
如果你想深入了解UIWidgets并且使用它构建线上项目,请访问项目Github仓库了解更多(https://github.com/UnityTech/ConnectAppCN)。
目前开发团队仍在改进UIWidgets Wiki。 由于UIWidgets主要来源于Flutter,你也可以参考Flutter Wiki中与UIWidgets API对应部分的详细描述。同时,你可以加入我们的讨论组( https://connect.unity.com/g/uiwidgets )。
目前开发团队仍在改进UIWidgets Wiki。 由于UIWidgets主要来源于Flutter,你也可以参考Flutter Wiki中与UIWidgets API对应部分的详细描述。
同时,你可以加入我们的讨论组( https://connect.unity.com/g/uiwidgets )。
#### 常问问题解答

26
README.md


#### Automatically Adjust Frame Rate
To build an App that is able to adjust the frame rate automatically, please open Project Settings, and in the Quality tab, set the "V Sync Count" option of the target platform to "Don't Sync".
The default logic is to set the frame rate to 25 when the screen is static, and change the frame rate to 60 whenever the screen changes.
If you would like to modify the behavior of speeding up or cooling down the frame rate, please set `Window.onFrameRateSpeedUp` and/or `Window.onFrameRateCoolDown` to your own functions.
The default logic is to reduce the frame rate when the screen is static, and change it back to 60 whenever the screen changes.
If you would like to disable this behavior, please set `Window.onFrameRateSpeedUp` and/or `Window.onFrameRateCoolDown` to null function, i.e., () => {}.
Note that in Unity 2019.3 and above, UIWidgets will use OnDemandRenderAPI to implement this feature, which will greatly save the battery.
#### WebGL Canvas Device Pixel Ratio Plugin
The width and height of the Canvas in browser may differ from the number of pixels the Canvas occupies on the screen.

With the provided packaged stateful widget `UnityObjectDetector` and its `onRelease` callback function, you can easily drag some objects (for example GameObject from Hierarchy, files from Project Window, etc) into the area, get the UnityEngine.Object[] references and make further modification.
Please refer to "UIWidgetsTests -> Drag&Drop" for simple examples.
## Debug UIWidgets Application

## Learn
#### Samples
You can find many UIWidgets App samples in the UIWidgets package in the **Samples** folder.
Feel free to try them out and make modifications to see the results.
To get started, the UIWidgetsTheatre scene provides you
a list of carefully selected samples to start with.
You can also try UIWidgets-based Editor windows by clicking **UIWidgetsTest** on the main menu
You can find many UIWidgets sample projects on Github, which covers different aspects and provide you
learning materials in various levels:
* UIWidgetsSamples (https://github.com/UIWidgets/UIWidgetsSamples). These samples are developed by the dev team in order to illustrates all the features of
UIWidgets. Clone this Repo to the **Assets** folder of your local UIWidgets project and then
you can find all the sample scenes under the **Scene** folder.
You can also try UIWidgets-based Editor windows by clicking the new **UIWidgetsTests** tab on the main menu
* awesome-UIWidgets by Liangxie (https://github.com/liangxiegame/awesome-uiwidgets). This Repo contains
lots of UIWidget demos apps and third-party applications.
* ConnectApp (https://github.com/UnityTech/ConnectAppCN). This is an online, open-source UIWidget-based App developed
by the dev team. If you are making your own App with UIWidgets, this project will provides you with
many best practice cases.
#### Wiki
The develop team is still working on the UIWidgets Wiki. However, since UIWidgets is mainly derived from Flutter,

正在加载...
取消
保存