Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

remove Samples #369

Merged
merged 31 commits into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
790f210
Remove Samples.
Oct 21, 2019
1f5d224
Cleanup resources in Tests.
Oct 21, 2019
ca32585
Merge branch 'master' into cleanup
Oct 21, 2019
a061086
Fix font path.
Oct 21, 2019
24278e5
Update Documentation.
Oct 21, 2019
64d7120
Update QAReport and package.json.
Oct 21, 2019
8d5c19a
Fix README.
Oct 21, 2019
a83057b
Merge pull request #352 from UnityTech/master
zhuxingwei Oct 21, 2019
eb64c02
Merge pull request #351 from UnityTech/cleanup
zhuxingwei Oct 21, 2019
d951ced
Merge pull request #356 from UnityTech/master
zhuxingwei Oct 31, 2019
f97b76f
Fix emoji size.
Nov 1, 2019
4f5f770
Merge pull request #359 from UnityTech/fix_emoji
zhuxingwei Nov 1, 2019
4b65f9c
Merge pull request #361 from UnityTech/master
zhuxingwei Nov 1, 2019
b4be863
Merge pull request #368 from UnityTech/master
zhuxingwei Nov 8, 2019
cbbed8b
clean test codes and unused scripts + rename folders
zhuxingwei Nov 11, 2019
8655eda
fix readme
zhuxingwei Nov 11, 2019
714f758
fix readme typos
zhuxingwei Nov 11, 2019
d847468
fix readme typos
zhuxingwei Nov 11, 2019
58e2547
Update emoji resources to apple.
Nov 12, 2019
a22102d
Fix some issues.
Nov 12, 2019
a2d30e3
Merge pull request #371 from UnityTech/fix_emoji
zhuxingwei Nov 12, 2019
664d48e
Fix typo.
Nov 13, 2019
f6fe372
Merge pull request #372 from UnityTech/master
zhuxingwei Nov 13, 2019
3640ff4
Merge branch 'master' of https://github.com/UnityTech/UIWidgets into …
Nov 14, 2019
8dff2ff
Fix typo.
Nov 14, 2019
ca7cd51
Merge branch 'dev' of https://github.com/UnityTech/UIWidgets into fix…
Nov 14, 2019
8e6c632
Merge pull request #374 from UnityTech/fix_emoji
zhuxingwei Nov 14, 2019
3d08420
Add default image for unfound emoji.
Nov 14, 2019
f8b6b1f
Merge pull request #375 from UnityTech/fix_emoji
zhuxingwei Nov 14, 2019
425f8d0
Update alpha is transparency.
Nov 14, 2019
2cd5b7e
Merge pull request #376 from UnityTech/fix_emoji
zhuxingwei Nov 14, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 37 additions & 0 deletions Documentation~/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
This repository exists for the sole purpose of publishing to package manager. Please contribute to https://github.com/UnityTech/UIWidgets instead.

# Contributing

## If you are interested in contributing, here are some ground rules:

### Code Style (using JetBrains Rider)
1. **Import the Customized Code Cleanup Settings**: Open Preferences -> Manage Layers,
Choose 'Solution "\<YourProjectName\>" personal' and Click "Add Layer" ("+") -> "Open Settings File...".
and Open the file "UIWidgetCleanupPlugin.DotSettings" under \<YourProjectPath\>/Packages/com.unity.uiwidgets/"

2. **Cleanup Code style using the Customized Code Cleanup Settings**: Open Code -> Code Cleanup,
Pick a Cleanup scope as you want and Choose "UIWidgets" as the "Code cleanup profile", then click "OK"

3. **Refine Code Style Rules**: Edit the ".editorconfig" file under \<YourProjectPath\>/Packages/com.unity.uiwidgets/". Visit
https://www.jetbrains.com/help/rider/EditorConfig_Index.html for the detailed.

### Generate Code.

Code files ending with ".gen.cs" are auto generated. Follow these steps to generate them:

1. **Go to scripts Folder and Run npm install**:
```
cd <YourProjectPath>/Packages/com.unity.uiwidgets/scripts~
npm install
```

2. **Run the codegen Command**:
```
node uiwidgets-cli.js codegen . generate mixin code
```


## All contributions are subject to the [Unity Contribution Agreement(UCA)](https://unity3d.com/legal/licenses/Unity_Contribution_Agreement)
By making a pull request, you are confirming agreement to the terms and conditions of the UCA, including that your Contributions are your original creation and that you have complete right and authority to make your Contributions.

## Once you have a change ready following these ground rules. Simply make a pull request
2 changes: 2 additions & 0 deletions Documentation~/TableOfContents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* [UIWidgets Documentation](index)
* [UIWidgets中文文档](index-zh)
356 changes: 356 additions & 0 deletions Documentation~/com.unity.uiwidgets.md

Large diffs are not rendered by default.

Binary file removed Documentation~/images/example.png
Binary file not shown.
315 changes: 315 additions & 0 deletions Documentation~/index-zh.md

Large diffs are not rendered by default.

356 changes: 356 additions & 0 deletions Documentation~/index.md

Large diffs are not rendered by default.

169 changes: 0 additions & 169 deletions Documentation~/your-package-name.md

This file was deleted.

29 changes: 12 additions & 17 deletions QAReport.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
# Quality Report
Use this file to outline the test strategy for this package.

## Version tested: [*package version*]
## Version tested: [1.0.3-preview]

## QA Owner: [*Add Name*]
## UX Owner: [*Add Name*]
## QA Owner: Jason Fu
## UX Owner: Yuncong Zhang

## Test strategy
*Use this section to describe how this feature was tested.*
* A link to the Test Plan (Test Rails, other)
* Results from the package's editor and runtime test suite.
* Link to automated test results (if any)
* Manual test Results, [here's an example](https://docs.google.com/spreadsheets/d/12A76U5Gf969w10KL4Ik0wC1oFIBDUoRrqIvQgD18TFo/edit#gid=0)
* Scenario test week outcome
* etc.
```
Overall result: PASS
Total Tests run: 4, Passed: 4, Failures: 0, Errors: 0, Inconclusives: 0
Total not run : 0, Invalid: 0, Ignored: 0, Skipped: 0
```
* Test Rail Scenarios:https://qatestrail.hq.unity3d.com/index.php?/suites/view/67&group_by=cases:section_id&group_order=asc&group_id=76244
* Editor/Runtime Test Suite:
* Manual test Results: https://qatestrail.hq.unity3d.com/index.php?/runs/view/13298&group_by=cases:section_id&group_order=asc

## Package Status
Use this section to describe:
* UX status/evaluation results
* package stability
* known bugs, issues
* performance metrics,
* etc

In other words, a general feeling on the health of this package.
* Stable
56 changes: 44 additions & 12 deletions README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ UIWidgets也支持Gif!

#### 七、自动调节帧率
如果要使得构建出的应用能够自动调节帧率,请打开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程序中画面可能会模糊。
Expand Down Expand Up @@ -223,9 +225,34 @@ $JSEvents
在UIWidgets中使用图片时,记得将这一特性关闭,以免图片被意外放缩,方法如下:在Project面板中选中图片,在"Inspector"面板中将"Non Power of 2"(在"Advanced"中)设置为"None"。

#### 十、更新表情(Emoji)
UIWidgets支持渲染文本中包含的表情。表情的图片来自[Google Emoji](https://emojipedia.org/google)提供的免费资源。
如果您希望使用自己的表情图片,请更新纹理图`Tests/Resources/Emoji.png`,以及`Runtime/ui/txt/emoji.cs`中将Unicode映射到纹理图中具体位置的映射表。
特别地,请记得更新Dictionary变量`emojiLookupTable`,纹理图的行数`rowCount`以及纹理图的列数`colCount`。
UIWidgets支持渲染文本中包含的表情。
默认的表情资源为[iOS 13.2](https://emojipedia.org/apple/ios-13.2)。
我们也准备了[Google Emoji](https://emojipedia.org/google)的表情资源。
如果您希望切换到Google版本的表情,请按如下步骤操作:

1. 拷贝`Runtime/Resources/backup~/EmojiGoogle.png`到`Runtime/Resources/images`目录。
2. 在**Project**面板中,找到`EmojiGoogle`资源,在**Inspector**面板中,将**Max Size**更改为4096,取消选中**Generate Mipmaps**,并选中**Alpha Is Transparency**。
3. 在您的代码中继承`UIWidgetsPanel`的类的`OnEnable()`函数中,添加如下代码

```csharp
EmojiUtils.configuration = EmojiUtils.googleEmojiConfiguration;
```

如果您希望使用自己的表情图片,请按如下步骤操作:

1. 参照`EmojiGoogle.png`,创建您自己的Emoji表单,并放到工程目录下的某个`Resources`目录中,例如`Resources/myImages/MyEmoji.png`)。
2. 在`OnEnable()`函数中,添加如下代码(记得将示例的值改为真实的值)。注意Emoji的编码的顺序要和Emoji表单一致。

```csharp
EmojiUtils.configuration = new EmojiResourceConfiguration(
spriteSheetAssetName: "myImage/MyEmoji",
emojiCodes: new List<int> {
0x1f004, 0x1f0cf, 0x1f170, ...
},
spriteSheetNumberOfRows: 36,
spriteSheetNumberOfColumns: 37,
);
```

#### 十一、与GameObject进行拖拽交互

Expand All @@ -235,8 +262,6 @@ UIWidgets支持渲染文本中包含的表情。表情的图片来自[Google Emo

我们提供了一个包装好的`UnityObjectDetector`组件以及`onRelease`回调函数,借此您可以实现简单地将物体(例如Hierarchy内的场景物体、Project窗口下的文件等)拖拽至区域内,来获得`UnityEngine.Object[] `类型的引用并进行操作。

你可以在“UIWidgetsTests -> Drag&Drop”下找到简单的实例样例。


## 调试UIWidgets应用程序

Expand All @@ -256,15 +281,22 @@ UIWidgets Inspector工具用于可视化和浏览窗口小部件树。 你可以

## 学习

#### 示例

你可以在**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 )。

#### Wiki

目前开发团队仍在改进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 )。

#### 常问问题解答

Expand Down
Loading