You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 29, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: Documentation~/com.unity.uiwidgets.md
+47-17Lines changed: 47 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
# UIWidgets
2
+
[中文](README-ZH.md)
2
3
3
4
4
5
## Introduction
@@ -228,8 +229,10 @@ Status bar is always hidden by default when an Unity project is running on an An
228
229
#### Automatically Adjust Frame Rate
229
230
230
231
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".
231
-
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.
232
-
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.
232
+
The default logic is to reduce the frame rate when the screen is static, and change it back to 60 whenever the screen changes.
233
+
If you would like to disable this behavior, please set `Window.onFrameRateSpeedUp` and `Window.onFrameRateCoolDown` to null function, i.e., () => {}.
234
+
235
+
Note that in Unity 2019.3 and above, UIWidgets will use OnDemandRenderAPI to implement this feature, which will greatly save the battery.
233
236
234
237
#### WebGL Canvas Device Pixel Ratio Plugin
235
238
The width and height of the Canvas in browser may differ from the number of pixels the Canvas occupies on the screen.
@@ -258,12 +261,34 @@ Unity, by default, resizes the width and height of an imported image to the near
258
261
In UIWidgets, you should almost always disable this by selecting the image in the "Project" panel, then in the "Inspector" panel set the "Non Power of 2" option (in "Advanced") to "None", to prevent your image from being resized unexpectedly.
259
262
260
263
#### Update Emoji
261
-
UIWidgets supports rendering emoji in (editable) texts. The emoji images comes from the free
262
-
resources provided by [Google Emoji](https://emojipedia.org/google). If you would
263
-
like to use your own images for emoji, please update the texture image `Tests/Resources/Emoji.png`,
264
-
and the unicode-index table in `Runtime/ui/txt/emoji.cs` which maps unicodes to specific locations
265
-
in the texture. Specifically, remember to update the Dictionary `emojiLookupTable`, number of rows
266
-
in the texture `rowCount`, and number of columns `colCount`.
264
+
UIWidgets supports rendering emoji in (editable) texts.
265
+
The default emoji resource version is [iOS 13.2](https://emojipedia.org/apple/ios-13.2).
266
+
We also prepared the resources of [Google Emoji](https://emojipedia.org/google).
267
+
To switch to Google version of emoji, please follow the following steps:
268
+
269
+
1. Copy `Runtime/Resources/backup~/EmojiGoogle.png` to `Runtime/Resources/images` folder.
270
+
2. In the **Project** panel, find and select `EmojiGoogle` asset, and in the **Inspector** panel, change **Max Size** to 4096, and disable **Generate Mipmaps**.
271
+
3. In the `OnEnable()` function in your class overriding `UIWidgetsPanel`, add the following code
If you would like to use your own images for emoji, please follow the following steps:
278
+
279
+
1. Create the sprite sheet (take `EmojiGoogle.png` as an example), and put in a `Resources` folder in your project, (for example `Resources/myImages/MyEmoji.png`).
280
+
2. In the `OnEnable()` function, add the following code (replace example values with actual value). Note that the order of emoji codes should be consistent with the sprite sheet.
@@ -273,8 +298,6 @@ in the texture `rowCount`, and number of columns `colCount`.
273
298
274
299
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.
275
300
276
-
Please refer to "UIWidgetsTests -> Drag&Drop" for simple examples.
277
-
278
301
279
302
## Debug UIWidgets Application
280
303
@@ -288,20 +311,27 @@ The symbol is for debug purpose, please remove it from your release build.
288
311
#### UIWidgets Inspector
289
312
The UIWidgets Inspector tool is for visualizing and exploring the widget trees. You can find it
290
313
via *Window/Analysis/UIWidgets* inspector in Editor menu.
314
+
291
315
**Note**
292
316
***UIWidgets_DEBUG** needs to be define for inspector to work properly.
293
317
* Inspector currently only works in Editor Play Mode, inspect standalone built application is not supported for now.
294
318
295
319
## Learn
296
320
297
321
#### Samples
298
-
You can find many UIWidgets App samples in the UIWidgets package in the **Samples** folder.
299
-
Feel free to try them out and make modifications to see the results.
300
-
To get started, the UIWidgetsTheatre scene provides you
301
-
a list of carefully selected samples to start with.
302
-
303
-
You can also try UIWidgets-based Editor windows by clicking **UIWidgetsTest** on the main menu
322
+
You can find many UIWidgets sample projects on Github, which cover different aspects and provide you
323
+
learning materials in various levels:
324
+
* UIWidgetsSamples (https://github.com/UIWidgets/UIWidgetsSamples). These samples are developed by the dev team in order to illustrates all the features of
325
+
UIWidgets. First clone this Repo to the **Assets** folder of your local UIWidgets project. Then
326
+
you can find all the sample scenes under the **Scene** folder.
327
+
You can also try UIWidgets-based Editor windows by clicking the new **UIWidgetsTests** tab on the main menu
304
328
and open one of the dropdown samples.
329
+
* awesome-UIWidgets by Liangxie (https://github.com/liangxiegame/awesome-uiwidgets). This Repo contains
330
+
lots of UIWidget demo apps and third-party applications.
331
+
* ConnectApp (https://github.com/UnityTech/ConnectAppCN). This is an online, open-source UIWidget-based App developed
332
+
by the dev team. If you are making your own App with UIWidgets, this project will provides you with
333
+
many best practice cases.
334
+
305
335
306
336
#### Wiki
307
337
The develop team is still working on the UIWidgets Wiki. However, since UIWidgets is mainly derived from Flutter,
@@ -324,4 +354,4 @@ Meanwhile, you can join the discussion channel at (https://connect.unity.com/g/u
Copy file name to clipboardExpand all lines: Documentation~/index.md
+47-17Lines changed: 47 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
# UIWidgets
2
+
[中文](README-ZH.md)
2
3
3
4
4
5
## Introduction
@@ -228,8 +229,10 @@ Status bar is always hidden by default when an Unity project is running on an An
228
229
#### Automatically Adjust Frame Rate
229
230
230
231
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".
231
-
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.
232
-
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.
232
+
The default logic is to reduce the frame rate when the screen is static, and change it back to 60 whenever the screen changes.
233
+
If you would like to disable this behavior, please set `Window.onFrameRateSpeedUp` and `Window.onFrameRateCoolDown` to null function, i.e., () => {}.
234
+
235
+
Note that in Unity 2019.3 and above, UIWidgets will use OnDemandRenderAPI to implement this feature, which will greatly save the battery.
233
236
234
237
#### WebGL Canvas Device Pixel Ratio Plugin
235
238
The width and height of the Canvas in browser may differ from the number of pixels the Canvas occupies on the screen.
@@ -258,12 +261,34 @@ Unity, by default, resizes the width and height of an imported image to the near
258
261
In UIWidgets, you should almost always disable this by selecting the image in the "Project" panel, then in the "Inspector" panel set the "Non Power of 2" option (in "Advanced") to "None", to prevent your image from being resized unexpectedly.
259
262
260
263
#### Update Emoji
261
-
UIWidgets supports rendering emoji in (editable) texts. The emoji images comes from the free
262
-
resources provided by [Google Emoji](https://emojipedia.org/google). If you would
263
-
like to use your own images for emoji, please update the texture image `Tests/Resources/Emoji.png`,
264
-
and the unicode-index table in `Runtime/ui/txt/emoji.cs` which maps unicodes to specific locations
265
-
in the texture. Specifically, remember to update the Dictionary `emojiLookupTable`, number of rows
266
-
in the texture `rowCount`, and number of columns `colCount`.
264
+
UIWidgets supports rendering emoji in (editable) texts.
265
+
The default emoji resource version is [iOS 13.2](https://emojipedia.org/apple/ios-13.2).
266
+
We also prepared the resources of [Google Emoji](https://emojipedia.org/google).
267
+
To switch to Google version of emoji, please follow the following steps:
268
+
269
+
1. Copy `Runtime/Resources/backup~/EmojiGoogle.png` to `Runtime/Resources/images` folder.
270
+
2. In the **Project** panel, find and select `EmojiGoogle` asset, and in the **Inspector** panel, change **Max Size** to 4096, and disable **Generate Mipmaps**.
271
+
3. In the `OnEnable()` function in your class overriding `UIWidgetsPanel`, add the following code
If you would like to use your own images for emoji, please follow the following steps:
278
+
279
+
1. Create the sprite sheet (take `EmojiGoogle.png` as an example), and put in a `Resources` folder in your project, (for example `Resources/myImages/MyEmoji.png`).
280
+
2. In the `OnEnable()` function, add the following code (replace example values with actual value). Note that the order of emoji codes should be consistent with the sprite sheet.
@@ -273,8 +298,6 @@ in the texture `rowCount`, and number of columns `colCount`.
273
298
274
299
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.
275
300
276
-
Please refer to "UIWidgetsTests -> Drag&Drop" for simple examples.
277
-
278
301
279
302
## Debug UIWidgets Application
280
303
@@ -288,20 +311,27 @@ The symbol is for debug purpose, please remove it from your release build.
288
311
#### UIWidgets Inspector
289
312
The UIWidgets Inspector tool is for visualizing and exploring the widget trees. You can find it
290
313
via *Window/Analysis/UIWidgets* inspector in Editor menu.
314
+
291
315
**Note**
292
316
***UIWidgets_DEBUG** needs to be define for inspector to work properly.
293
317
* Inspector currently only works in Editor Play Mode, inspect standalone built application is not supported for now.
294
318
295
319
## Learn
296
320
297
321
#### Samples
298
-
You can find many UIWidgets App samples in the UIWidgets package in the **Samples** folder.
299
-
Feel free to try them out and make modifications to see the results.
300
-
To get started, the UIWidgetsTheatre scene provides you
301
-
a list of carefully selected samples to start with.
302
-
303
-
You can also try UIWidgets-based Editor windows by clicking **UIWidgetsTest** on the main menu
322
+
You can find many UIWidgets sample projects on Github, which cover different aspects and provide you
323
+
learning materials in various levels:
324
+
* UIWidgetsSamples (https://github.com/UIWidgets/UIWidgetsSamples). These samples are developed by the dev team in order to illustrates all the features of
325
+
UIWidgets. First clone this Repo to the **Assets** folder of your local UIWidgets project. Then
326
+
you can find all the sample scenes under the **Scene** folder.
327
+
You can also try UIWidgets-based Editor windows by clicking the new **UIWidgetsTests** tab on the main menu
304
328
and open one of the dropdown samples.
329
+
* awesome-UIWidgets by Liangxie (https://github.com/liangxiegame/awesome-uiwidgets). This Repo contains
330
+
lots of UIWidget demo apps and third-party applications.
331
+
* ConnectApp (https://github.com/UnityTech/ConnectAppCN). This is an online, open-source UIWidget-based App developed
332
+
by the dev team. If you are making your own App with UIWidgets, this project will provides you with
333
+
many best practice cases.
334
+
305
335
306
336
#### Wiki
307
337
The develop team is still working on the UIWidgets Wiki. However, since UIWidgets is mainly derived from Flutter,
@@ -324,4 +354,4 @@ Meanwhile, you can join the discussion channel at (https://connect.unity.com/g/u
0 commit comments