GithubHelp home page GithubHelp logo

unitytech / uiwidgets Goto Github PK

View Code? Open in Web Editor NEW
2.0K 89.0 257.0 67.64 MB

UIWidget is a Unity Package which helps developers to create, debug and deploy efficient, cross-platform Apps.

License: Other

ShaderLab 0.70% C# 97.37% JavaScript 0.04% HLSL 0.09% Objective-C++ 0.69% Java 0.51% Objective-C 0.05% Nunjucks 0.55%
unity ui app flutter android ios webgl mobile uiwidgets cross-platform unity-engine unity-editor

uiwidgets's Introduction

⚠️ The main repository of UIWidgets has been moved to https://github.com/Unity-Technologies/com.unity.uiwidgets. Please visit the new site if you have an issue or want to contribute. Thanks!

UIWidgets

中文

Introduction

UIWidgets is a plugin package for Unity Editor which helps developers to create, debug and deploy efficient, cross-platform Apps using the Unity Engine.

UIWidgets is mainly derived from Flutter. However, taking advantage of the powerful Unity Engine, it offers developers many new features to improve their Apps as well as the develop workflow significantly.

Efficiency

Using the latest Unity rendering SDKs, a UIWidgets App can run very fast and keep >60fps in most times.

Cross-Platform

A UIWidgets App can be deployed on all kinds of platforms including PCs, mobile devices and web page directly, like any other Unity projects.

Multimedia Support

Except for basic 2D UIs, developers are also able to include 3D Models, audios, particle-systems to their UIWidgets Apps.

Developer-Friendly

A UIWidgets App can be debug in the Unity Editor directly with many advanced tools like CPU/GPU Profiling, FPS Profiling.

Example

Projects using UIWidgets

Unity Connect App

The Unity Connect App is created using UIWidgets and available for both Android (https://connect.unity.com/connectApp/download) and iOS (Searching for "Unity Connect" in App Store). This project is open-sourced @https://github.com/UnityTech/ConnectAppCN.

Unity Chinese Doc

The official website of Unity Chinese Documentation (https://connect.unity.com/doc) is powered by UIWidgets and open-sourced @https://github.com/UnityTech/DocCN.

Requirements

Unity

Install Unity 2018.4.10f1 (LTS) or Unity 2019.1.14f1 and above. You can download the latest Unity on https://unity3d.com/get-unity/download.

UIWidgets Package

Visit our Github repository https://github.com/UnityTech/UIWidgets to download the latest UIWidgets package.

Move the downloaded package folder into the Package folder of your Unity project.

Generally, you can make it using a console (or terminal) application by just a few commands as below:

 cd <YourProjectPath>/Packages
 git clone https://github.com/UnityTech/UIWidgets.git com.unity.uiwidgets

Getting Start

i. Overview

In this tutorial, we will create a very simple UIWidgets App as the kick-starter. The app contains only a text label and a button. The text label will count the times of clicks upon the button.

First of all, please open or create a Unity Project and open it with Unity Editor.

And then open Project Settings, go to Player section and add "UIWidgets_DEBUG" to the Scripting Define Symbols field. This enables the debug mode of UIWidgets for your development. Remove this for your release build afterwards.

ii. Scene Build

A UIWidgets App is usually built upon a Unity UI Canvas. Please follow the steps to create a UI Canvas in Unity.

  1. Create a new Scene by "File -> New Scene";
  2. Create a UI Canvas in the scene by "GameObject -> UI -> Canvas";
  3. Add a Panel (i.e., Panel 1) to the UI Canvas by right click on the Canvas and select "UI -> Panel". Then remove the Image Component from the Panel.

iii. Create Widget

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 "UIWidgetsExample.cs" and paste the following codes into it.

     using System.Collections.Generic;
     using Unity.UIWidgets.animation;
     using Unity.UIWidgets.engine;
     using Unity.UIWidgets.foundation;
     using Unity.UIWidgets.material;
     using Unity.UIWidgets.painting;
     using Unity.UIWidgets.ui;
     using Unity.UIWidgets.widgets;
     using UnityEngine;
     using FontStyle = Unity.UIWidgets.ui.FontStyle;
    
     namespace UIWidgetsSample {
         public class UIWidgetsExample : UIWidgetsPanel {
             protected override void OnEnable() {
                 // if you want to use your own font or font icons.
                 // FontManager.instance.addFont(Resources.Load<Font>(path: "path to your font"), "font family name");
    
                 // load custom font with weight & style. The font weight & style corresponds to fontWeight, fontStyle of
                 // a TextStyle object
                 // FontManager.instance.addFont(Resources.Load<Font>(path: "path to your font"), "Roboto", FontWeight.w500,
                 //    FontStyle.italic);
    
                 // add material icons, familyName must be "Material Icons"
                 // FontManager.instance.addFont(Resources.Load<Font>(path: "path to material icons"), "Material Icons");
    
                 base.OnEnable();
             }
    
             protected override Widget createWidget() {
                 return new WidgetsApp(
                     home: new ExampleApp(),
                     pageRouteBuilder: (RouteSettings settings, WidgetBuilder builder) =>
                         new PageRouteBuilder(
                             settings: settings,
                             pageBuilder: (BuildContext context, Animation<float> animation,
                                 Animation<float> secondaryAnimation) => builder(context)
                         )
                 );
             }
    
             class ExampleApp : StatefulWidget {
                 public ExampleApp(Key key = null) : base(key) {
                 }
    
                 public override State createState() {
                     return new ExampleState();
                 }
             }
    
             class ExampleState : State<ExampleApp> {
                 int counter = 0;
    
                 public override Widget build(BuildContext context) {
                     return new Column(
                         children: new List<Widget> {
                             new Text("Counter: " + this.counter),
                             new GestureDetector(
                                 onTap: () => {
                                     this.setState(()
                                         => {
                                         this.counter++;
                                     });
                                 },
                                 child: new Container(
                                     padding: EdgeInsets.symmetric(20, 20),
                                     color: Colors.blue,
                                     child: new Text("Click Me")
                                 )
                             )
                         }
                     );
                 }
             }
         }
     }
  2. Save this script and attach it to Panel 1 as its component.

  3. Press the "Play" Button to start the App in Unity Editor.

iv. Build App

Finally, the UIWidgets App can be built to packages for any specific platform by the following steps.

  1. Open the Build Settings Panel by "File -> Build Settings..."
  2. Choose a target platform and click "Build". Then the Unity Editor will automatically assemble all relevant resources and generate the final App package.

How to load images?

  1. Put your images files in Resources folder. e.g. image1.png.
  2. You can add [email protected] and [email protected] in the same folder to support HD screens.
  3. Use Image.asset("image1") to load the image. Note: as in Unity, ".png" is not needed.

UIWidgets supports Gif as well!

  1. Suppose you have loading1.gif. Rename it to loading1.gif.bytes and copy it to Resources folder.
  2. You can add [email protected] and [email protected] in the same folder to support HD screens.
  3. Use Image.asset("loading1.gif") to load the gif images.

Using Window Scope

If you see the error AssertionError: Window.instance is null or null pointer error of Window.instance, it means the code is not running in the window scope. In this case, you can enclose your code with window scope as below:

using(WindowProvider.of(your gameObject with UIWidgetsPanel).getScope()) {
    // code dealing with UIWidgets,
    // e.g. setState(() => {....})
}

This is needed if the code is in methods not invoked by UIWidgets. For example, if the code is in completed callback of UnityWebRequest, you need to enclose them with window scope. Please see HttpRequestSample for detail. For callback/event handler methods from UIWidgets (e.g Widget.build, State.initState...), you don't need do it yourself, since the framework ensure it's in window scope.

Show Status Bar on Android

Status bar is always hidden by default when an Unity project is running on an Android device. If you want to show the status bar in your App, this solution seems to be compatible to UIWidgets, therefore can be used as a good option before we release our full support solution on this issue.

Besides, please set "Render Outside Safe Area" to true in the "Player Settings" to make this plugin working properly on Android P or later.

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 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 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. Therefore, the image may blur in the builded WebGL program. The Plugin Plugins/platform/webgl/UIWidgetsCanvasDevicePixelRatio_20xx.x.jslib (2018.3 and 2019.1 for now) solves this issue. Please select the plugin of the Unity version corresponding to your project, and disable other versions of this plugin, as follows: select this plugin in the Project panel, and uncheck WebGL under Select platforms for plugin in the Inspector panel. If you need to disable this plugin for any reason, please disable all the versions of this plugin as described above.

This plugin overrides the following parameters in the Unity WebGL building module:

JS_SystemInfo_GetWidth
JS_SystemInfo_GetHeight
JS_SystemInfo_GetCurrentCanvasWidth
JS_SystemInfo_GetCurrentCanvasHeight
$Browser
$JSEvents

If you would like to implement your own WebGL plugin, and your plugin overrides at least one of the above parameters, you need to disable the UIWidgetsCanvasDevicePixelRatio plugin in the above mentioned way to avoid possible conflicts. If you still need the function provided by this plugin, you can mannually apply the modification to Unity WebGL building module introduced in this plugin. All the modifications introduced in UIWidgetsCanvasDevicePixelRatio are marked by ////////// Modifcation Start //////////// and ////////// Modifcation End ////////////. In the marked codes, all the multiplications and divisions with devicePixelRatio are introduced by our modification. To learn about the original script in detail, please refer to SystemInfo.js and UnityNativeJS/UnityNative.js in PlaybackEngines/WebGLSupport/BuildTools/lib in your Unity Editor installation.

Image Import Setting

Unity, by default, resizes the width and height of an imported image to the nearest integer that is a power of 2. 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.

Update Emoji

UIWidgets supports rendering emoji in (editable) texts. The default emoji resource version is iOS 13.2. We also prepared the resources of Google Emoji. To switch to Google version of emoji, please follow the following steps:

  1. Copy Runtime/Resources/backup~/EmojiGoogle.png to Runtime/Resources/images folder.
  2. In the Project panel, find and select EmojiGoogle asset, and in the Inspector panel, change Max Size to 4096, disable Generate Mipmaps, and enable Alpha Is Transparency.
  3. In the OnEnable() function in your class overriding UIWidgetsPanel, add the following code
EmojiUtils.configuration = EmojiUtils.googleEmojiConfiguration;

If you would like to use your own images for emoji, please follow the following steps:

  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).
  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.
EmojiUtils.configuration = new EmojiResourceConfiguration(
  spriteSheetAssetName: "myImage/MyEmoji",
  emojiCodes: new List<int> {
    0x1f004, 0x1f0cf, 0x1f170, ...
  },
  spriteSheetNumberOfRows: 36,
  spriteSheetNumberOfColumns: 37,
);

Interact with GameObject Drag&Drops

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.

Debug UIWidgets Application

Define UIWidgets_DEBUG

It's recommended to define the UIWidgets_DEBUG script symbol in editor, this will turn on debug assertion in UIWidgets, which will help to find potential bugs earlier. To do this: please go to Player Settings -> Other Settings -> Configuration -> Scripting Define Symbols, and add UIWidgets_DEBUG. The symbol is for debug purpose, please remove it from your release build.

UIWidgets Inspector

The UIWidgets Inspector tool is for visualizing and exploring the widget trees. You can find it via Window/Analysis/UIWidgets inspector in Editor menu.

Note

  • UIWidgets_DEBUG needs to be define for inspector to work properly.
  • Inspector currently only works in Editor Play Mode, inspect standalone built application is not supported for now.

Learn

Samples

You can find many UIWidgets sample projects on Github, which cover 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. First clone this Repo to the Assets folder of your local UIWidgets project. 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 and open one of the dropdown samples.
  • awesome-UIWidgets by Liangxie (https://github.com/liangxiegame/awesome-uiwidgets). This Repo contains lots of UIWidget demo 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, you can refer to Flutter Wiki to access detailed descriptions of UIWidgets APIs from those of their Flutter counterparts. Meanwhile, you can join the discussion channel at (https://connect.unity.com/g/uiwidgets)

FAQ

Question Answer
Can I create standalone App using UIWidgets? Yes
Can I use UIWidgets to build game UIs? Yes
Can I develop Unity Editor plugins using UIWidgets? Yes
Is UIWidgets a extension of UGUI/NGUI? No
Is UIWidgets just a copy of Flutter? No
Can I create UI with UIWidgets by simply drag&drop? No
Do I have to pay for using UIWidgets? No
Any IDE recommendation for UIWidgets? Rider, VSCode(Open .sln)

How to Contribute

Check CONTRIBUTING.md

uiwidgets's People

Contributors

fzhangtj avatar gewentao avatar iizzaya avatar jiangzhen3s avatar joce-unity avatar kgdev avatar wglios avatar yczhangsjtu avatar zhuxingwei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uiwidgets's Issues

文本框没有高亮选中文字&光标切换延迟

系统环境:Windows 10 64位专业版
软件环境:Unity 2018.3.5f1
问题描述:新建工程后,直接导入当前版本的UIWidgets包,在附带的测试场景(Samples/UIWidgetSample/TextInput)中,发现如下问题:

  1. 选中高亮:输入文本后,尝试选择文本进行编辑,选中的文本没有背景高亮,无法判断哪些文字被选中。
  2. 切换延迟:选中某个文本框之后,再选择另一个文本框,光标不能马上切换到新的文本框,会延迟大约半秒,如果这时输入内容,会把内容输入到上一个文本框。

建议直接在releases下放Unitypackage

既然是针对Unity的,那么怎么少得了更加简单明了的unitypackage呢,对应发布版本发布到release里,一目了然,开发者直接下对应的版本,双击即可导入到unity中,便捷。

建议遵循C#语言的一般命名规则

C#开发者表示看到JavaScript/Dart命名风格很难受🤐,其实是不习惯,每次更新后都要把脚本统一处理一遍。入乡随俗希望理解谢谢🙏。 还有#36 提到的问题也望重视。

P.S. 只是一个小小小建议,如果能的话更好,再次对开发者的贡献表示感谢。

Refresh case sensitivity failure.

Unity version: Unity 2018.3.0f2

Refresh case sensitivity failure. Asset: Packages/com.unity.uiwidgets/Runtime/Resources/UIWidgets_canvas_convexfill.shader ; Metafile: Packages/com.unity.uiwidgets/Runtime/Resources/UIWidgets_canvas_convexfill.shader.meta

不能在异步函数的回调中 setState

NullReferenceException: Object reference not set to an instance of an object
Unity.UIWidgets.scheduler.SchedulerBinding.scheduleFrame () (at Packages/com.unity.uiwidgets/Runtime/scheduler/binding.cs:184)
Unity.UIWidgets.scheduler.SchedulerBinding.ensureVisualUpdate () (at Packages/com.unity.uiwidgets/Runtime/scheduler/binding.cs:162)
Unity.UIWidgets.widgets.WidgetsBinding._handleBuildScheduled () (at Packages/com.unity.uiwidgets/Runtime/widgets/binding.cs:108)
Unity.UIWidgets.widgets.BuildOwner.scheduleBuildFor (Unity.UIWidgets.widgets.Element element) (at Packages/com.unity.uiwidgets/Runtime/widgets/framework.cs:891)
Unity.UIWidgets.widgets.Element.markNeedsBuild () (at Packages/com.unity.uiwidgets/Runtime/widgets/framework.cs:2044)
Unity.UIWidgets.widgets.State.setState (Unity.UIWidgets.ui.VoidCallback fn) (at Packages/com.unity.uiwidgets/Runtime/widgets/framework.cs:510)
BookListState.<RequestBooks>b__2_0 (System.Object response) (at Assets/Scripts/BookListPage.cs:45)
HTTPHelper+<GetAsync>d__8`1[T].MoveNext () (at Assets/Scripts/HTTPHelper.cs:82)
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) (at <d7ac571ca2d04b2f981d0d886fa067cf>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at C:/buildslave/unity/build/Runtime/Export/UnitySynchronizationContext.cs:115)
UnityEngine.UnitySynchronizationContext:ExecuteTasks()

用 HTTPClient 异步发 Get 请求,在回调函数中 setState 报上面的错误。
具体仓库在 UIWidget-Practice,报错行数在 这里

还是说我写的姿势不对?

添加延迟调用方法

现在Flutter中 有Future.delayed()方法 延迟调用,但是在C#没有找到延迟调用的方法

使用TimeSpan的UI动画不能逐帧运行

使用TimeSpan的UI动画不能逐帧运行,例如:
在UI中添加一个Icon,使其在程序启动后逐渐放大。如果在点击Play按钮image之前先点击暂停按钮image,使程序逐帧运行,会发现动画并没有按预期逐帧放大,而是突然变大,暂停期间动画的value没有停止增长。

支持 相机的RenderTexture

通过调用调用设备摄像头->相机渲染RenderTexture->uiwidgets ,
实时映射设备相机到uiwidgets上。
类似ugui 的raw image

图文混排,图片较多时报错:RenderTexture.Create failed: requested size is too large.

RenderTexture.Create failed: requested size is too large.
UnityEngine.Graphics:ExecuteCommandBuffer()
Unity.UIWidgets.ui.PictureFlusher:flush(Picture) (at Packages/com.unity.uiwidgets/Runtime/ui/painting/canvas_impl.cs:758)
Unity.UIWidgets.ui.CommandBufferCanvas:flush() (at Packages/com.unity.uiwidgets/Runtime/ui/painting/canvas_impl.cs:1014)
Unity.UIWidgets.flow.RasterCache:_rasterizePicture(Picture, Matrix3, Single, MeshPool) (at Packages/com.unity.uiwidgets/Runtime/flow/raster_cache.cs:232)
Unity.UIWidgets.flow.RasterCache:getPrerolledImage(Picture, Matrix3, Single, Boolean, Boolean) (at Packages/com.unity.uiwidgets/Runtime/flow/raster_cache.cs:169)
Unity.UIWidgets.flow.PictureLayer:preroll(PrerollContext, Matrix3) (at Packages/com.unity.uiwidgets/Runtime/flow/picture_layer.cs:39)
Unity.UIWidgets.flow.ContainerLayer:prerollChildren(PrerollContext, Matrix3, Rect&) (at Packages/com.unity.uiwidgets/Runtime/flow/container_layer.cs:26)
Unity.UIWidgets.flow.TransformLayer:preroll(PrerollContext, Matrix3) (at Packages/com.unity.uiwidgets/Runtime/flow/transform_layer.cs:25)
Unity.UIWidgets.flow.ContainerLayer:prerollChildren(PrerollContext, Matrix3, Rect&) (at Packages/com.unity.uiwidgets/Runtime/flow/container_layer.cs:26)
Unity.UIWidgets.flow.ClipRectLayer:preroll(PrerollContext, Matrix3) (at Packages/com.unity.uiwidgets/Runtime/flow/clip_rect_layer.cs:19)
Unity.UIWidgets.flow.ContainerLayer:prerollChildren(PrerollContext, Matrix3, Rect&) (at Packages/com.unity.uiwidgets/Runtime/flow/container_layer.cs:26)
Unity.UIWidgets.flow.TransformLayer:preroll(PrerollContext, Matrix3) (at Packages/com.unity.uiwidgets/Runtime/flow/transform_layer.cs:25)
Unity.UIWidgets.flow.ContainerLayer:prerollChildren(PrerollContext, Matrix3, Rect&) (at Packages/com.unity.uiwidgets/Runtime/flow/container_layer.cs:26)
Unity.UIWidgets.flow.TransformLayer:preroll(PrerollContext, Matrix3) (at Packages/com.unity.uiwidgets/Runtime/flow/transform_layer.cs:25)
Unity.UIWidgets.flow.ContainerLayer:prerollChildren(PrerollContext, Matrix3, Rect&) (at Packages/com.unity.uiwidgets/Runtime/flow/container_layer.cs:26)
Unity.UIWidgets.flow.ClipRectLayer:preroll(PrerollContext, Matrix3) (at Packages/com.unity.uiwidgets/Runtime/flow/clip_rect_layer.cs:19)
Unity.UIWidgets.flow.ContainerLayer:prerollChildren(PrerollContext, Matrix3, Rect&) (at Packages/com.unity.uiwidgets/Runtime/flow/container_layer.cs:26)
Unity.UIWidgets.flow.TransformLayer:preroll(PrerollContext, Matrix3) (at Packages/com.unity.uiwidgets/Runtime/flow/transform_layer.cs:25)
Unity.UIWidgets.flow.ContainerLayer:prerollChildren(PrerollContext, Matrix3, Rect&) (at Packages/com.unity.uiwidgets/Runtime/flow/container_layer.cs:26)
Unity.UIWidgets.flow.TransformLayer:preroll(PrerollContext, Matrix3) (at Packages/com.unity.uiwidgets/Runtime/flow/transform_layer.cs:25)
Unity.UIWidgets.flow.ContainerLayer:prerollChildren(PrerollContext, Matrix3, Rect&) (at Packages/com.unity.uiwidgets/Runtime/flow/container_layer.cs:26)
Unity.UIWidgets.flow.TransformLayer:preroll(PrerollContext, Matrix3) (at Packages/com.unity.uiwidgets/Runtime/flow/transform_layer.cs:25)
Unity.UIWidgets.flow.ContainerLayer:prerollChildren(PrerollContext, Matrix3, Rect&) (at Packages/com.unity.uiwidgets/Runtime/flow/container_layer.cs:26)
Unity.UIWidgets.flow.TransformLayer:preroll(PrerollContext, Matrix3) (at Packages/com.unity.uiwidgets/Runtime/flow/transform_layer.cs:25)
Unity.UIWidgets.flow.LayerTree:preroll(ScopedFrame, Boolean) (at Packages/com.unity.uiwidgets/Runtime/flow/layer_tree.cs:35)
Unity.UIWidgets.flow.ScopedFrame:raster(LayerTree, Boolean) (at Packages/com.unity.uiwidgets/Runtime/flow/compositor_context.cs:27)
Unity.UIWidgets.editor.Rasterizer:_drawToSurface(LayerTree) (at Packages/com.unity.uiwidgets/Runtime/editor/rasterizer.cs:72)
Unity.UIWidgets.editor.Rasterizer:_doDraw(LayerTree) (at Packages/com.unity.uiwidgets/Runtime/editor/rasterizer.cs:56)
Unity.UIWidgets.editor.Rasterizer:draw(LayerTree) (at Packages/com.unity.uiwidgets/Runtime/editor/rasterizer.cs:40)
Unity.UIWidgets.editor.WindowAdapter:render(Scene) (at Packages/com.unity.uiwidgets/Runtime/editor/editor_window.cs:397)
Unity.UIWidgets.rendering.RenderView:compositeFrame() (at Packages/com.unity.uiwidgets/Runtime/rendering/view.cs:121)
Unity.UIWidgets.rendering.RendererBinding:drawFrame() (at Packages/com.unity.uiwidgets/Runtime/rendering/binding.cs:69)
Unity.UIWidgets.widgets.WidgetsBinding:drawFrame() (at Packages/com.unity.uiwidgets/Runtime/widgets/binding.cs:124)
Unity.UIWidgets.rendering.RendererBinding:_handlePersistentFrameCallback(TimeSpan) (at Packages/com.unity.uiwidgets/Runtime/rendering/binding.cs:61)
Unity.UIWidgets.scheduler.SchedulerBinding:_invokeFrameCallback(FrameCallback, TimeSpan, StackTrace) (at Packages/com.unity.uiwidgets/Runtime/scheduler/binding.cs:357)
Unity.UIWidgets.scheduler.SchedulerBinding:handleDrawFrame() (at Packages/com.unity.uiwidgets/Runtime/scheduler/binding.cs:298)
Unity.UIWidgets.scheduler.SchedulerBinding:_handleDrawFrame() (at Packages/com.unity.uiwidgets/Runtime/scheduler/binding.cs:235)
Unity.UIWidgets.editor.WindowAdapter:_beginFrame() (at Packages/com.unity.uiwidgets/Runtime/editor/editor_window.cs:264)
Unity.UIWidgets.editor.WindowAdapter:_doOnGUI(Event) (at Packages/com.unity.uiwidgets/Runtime/editor/editor_window.cs:272)
Unity.UIWidgets.editor.WindowAdapter:OnGUI(Event) (at Packages/com.unity.uiwidgets/Runtime/editor/editor_window.cs:240)
Unity.UIWidgets.engine.UIWidgetWindowAdapter:OnGUI(Event) (at Packages/com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs:56)
Unity.UIWidgets.engine.UIWidgetsPanel:Update() (at Packages/com.unity.uiwidgets/Runtime/engine/UIWidgetsPanel.cs:172)

UI Canvas visible on Safari but not on Chrome using WebGL

Environment:

  • Unity 2018.3.11f1
  • UIWidgets commit d76d753
  • Auto Graphics API

Issue:
When exported to WebGL, my project using UIWidgets won't display the UI on Chrome (showing default Skybox), but it works well on Safari (see images below). You can visit https://wizardly-goodall-109263.netlify.com/ for a test. The console in Chrome didn't throw any error when loading the scene. 🤔
image

Attachment:
https://www.dropbox.com/s/2ajywuu8ybbxxol/UIWidgets-Chrome-Issue-Sample.zip?dl=0

Graphical Glitches

Using the "MaterialSample" script
Device: LG Nexus 5
Build Type: Development Build (with UIWidgets_DEBUG)
Unity Version: 2018.3.2f1
Video: https://drive.google.com/open?id=1dTfn2fIeoCh-QgFABbdU8OQHwFEnX9VR
ADB Logcat:

03-27 16:00:57.380 12123 12148 I Unity   : SystemInfo CPU = ARMv7 VFPv3 NEON, Cores = 4, Memory = 1854mb
03-27 16:00:57.380 12123 12148 I Unity   : SystemInfo ARM big.LITTLE configuration: 4 big (mask: 0xf), 0 little (mask: 0x0)
03-27 16:00:57.381 12123 12148 I Unity   : ApplicationInfo com.Faizan.Personal.UIWidgetsChat version 0.1 build 7a95d0fe-7d9a-46ea-828b-c2e3c551e367
03-27 16:00:57.381 12123 12148 I Unity   : Built from '2018.3/staging' branch, Version '2018.3.2f1 (b3c100a4b73a)', Build type 'Development', Scripting Backend 'mono', CPU 'armeabi-v7a'
03-27 16:00:57.381 12123 12148 D Unity   : [EGL] Attaching window :0xaeb78f08
03-27 16:00:57.389 12123 12148 D Unity   : Mono path[0] = '/data/app/com.Faizan.Personal.UIWidgetsChat-1/base.apk/assets/bin/Data/Managed'
03-27 16:00:57.389 12123 12148 D Unity   : Mono config path = 'assets/bin/Data/Managed/etc'
03-27 16:00:57.391 12123 12148 D Unity   : PlayerConnection initialized from /data/app/com.Faizan.Personal.UIWidgetsChat-1/base.apk/assets/bin/Data (debug = 0)
03-27 16:00:57.392 12123 12148 E Unity   : Socket: set reusable port failed, error: Protocol not available(92)
03-27 16:00:57.392 12123 12148 E Unity   :  
03-27 16:00:57.392 12123 12148 E Unity   : (Filename: ./Runtime/Network/Sockets.cpp Line: 415)
03-27 16:00:57.392 12123 12148 E Unity   : 
03-27 16:00:57.392 12123 12148 E Unity   : Socket: set reusable port failed, error: Protocol not available(92)
03-27 16:00:57.392 12123 12148 E Unity   :  
03-27 16:00:57.392 12123 12148 E Unity   : (Filename: ./Runtime/Network/Sockets.cpp Line: 415)
03-27 16:00:57.392 12123 12148 E Unity   : 
03-27 16:00:57.392 12123 12148 E Unity   : Socket: set reusable port failed, error: Protocol not available(92)
03-27 16:00:57.392 12123 12148 E Unity   :  
03-27 16:00:57.392 12123 12148 E Unity   : (Filename: ./Runtime/Network/Sockets.cpp Line: 415)
03-27 16:00:57.392 12123 12148 E Unity   : 
03-27 16:00:57.393 12123 12148 E Unity   : Socket: set reusable port failed, error: Protocol not available(92)
03-27 16:00:57.393 12123 12148 E Unity   :  
03-27 16:00:57.393 12123 12148 E Unity   : (Filename: ./Runtime/Network/Sockets.cpp Line: 415)
03-27 16:00:57.393 12123 12148 E Unity   : 
03-27 16:00:57.393 12123 12148 D Unity   : PlayerConnection initialized network socket : 0.0.0.0 55310
03-27 16:00:57.393 12123 12148 D Unity   : PlayerConnection initialized unix socket : Unity-com.Faizan.Personal.UIWidgetsChat
03-27 16:00:57.394 12123 12148 D Unity   : Multi-casting "[IP] 192.168.0.44 [Port] 55310 [Flags] 2 [Guid] 4131676307 [EditorId] 2045121965 [Version] 1048832 [Id] AndroidPlayer([email protected]) [Debug] 0 [PackageName] AndroidPlayer" to [225.0.0.222:54997]...
03-27 16:00:57.394 12123 12148 D Unity   : Started listening to [0.0.0.0:55310]
03-27 16:00:57.676 12123 12148 D Unity   : InitializeScriptEngine OK (0xaebc2f00)
03-27 16:00:57.676 12123 12148 D Unity   : PlayerConnection already initialized - listening to [0.0.0.0:55310]
03-27 16:00:57.712 12123 12148 D Unity   : PlayerInitEngineNoGraphics OK
03-27 16:00:57.712 12123 12148 D Unity   : AndroidGraphics::Startup window =  0xaeb78f08
03-27 16:00:57.712 12123 12148 D Unity   : [EGL] Attaching window :0xaeb78f08
03-27 16:00:57.731 12123 12148 D Unity   : [EGL] Request: ES 3.1+AEP RGB0 000 0/0
03-27 16:00:57.731 12123 12148 D Unity   : [EGL] Checking ES 3.1 support...
03-27 16:00:57.731 12123 12148 D Unity   : [EGL] ES3.1 not supported
03-27 16:00:57.732 12123 12148 D Unity   : [EGL] Request: ES 3.1 RGB0 000 0/0
03-27 16:00:57.732 12123 12148 D Unity   : [EGL] Request: ES 3.0 RGB0 000 0/0
03-27 16:00:57.732 12123 12148 D Unity   : [EGL] Found: ID[1] ES 3.0 RGB16 565 0/0
03-27 16:00:57.742 12123 12148 D Unity   : GfxDevice: creating device client; threaded=1
03-27 16:00:57.743 12123 12148 D Unity   : [EGL] Request: ES 3.1+AEP RGB0 000 0/0
03-27 16:00:57.743 12123 12148 D Unity   : [EGL] Request: ES 3.1 RGB0 000 0/0
03-27 16:00:57.744 12123 12148 D Unity   : [EGL] Request: ES 3.0 RGB0 000 0/0
03-27 16:00:57.744 12123 12148 D Unity   : [EGL] Found: ID[1] ES 3.0 RGB16 565 0/0
03-27 16:00:57.752 12123 12148 D Unity   : [EGL] Request: ES 3.0 RGBA32 8888 0/0
03-27 16:00:57.759 12123 12148 D Unity   : [EGL] Found: ID[5] ES 3.0 RGBA32 8888 0/0
03-27 16:00:57.763 12123 12148 D Unity   : ANativeWindow: (1080/1920) RequestedResolution: (0/0) RenderingResolution: (0/0) EGLSurface: (1080/1920)
03-27 16:00:57.776 12123 12148 D Unity   : Renderer: Adreno (TM) 330
03-27 16:00:57.776 12123 12148 D Unity   : Vendor:   Qualcomm
03-27 16:00:57.776 12123 12148 D Unity   : Version:  OpenGL ES 3.0 [email protected] AU@  (GIT@I96aee987eb)
03-27 16:00:57.776 12123 12148 D Unity   : GLES:     3
03-27 16:00:57.776 12123 12148 D Unity   :  GL_AMD_compressed_ATC_texture GL_AMD_performance_monitor GL_AMD_program_binary_Z400 GL_EXT_debug_label GL_EXT_debug_marker GL_EXT_discard_framebuffer GL_EXT_robustness GL_EXT_texture_format_BGRA8888 GL_EXT_texture_type_2_10_10_10_REV GL_NV_fence GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_depth24 GL_OES_EGL_image GL_OES_EGL_sync GL_OES_EGL_image_external GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_packed_depth_stencil GL_OES_depth_texture_cube_map GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_vertex_type_10_10_10_2 GL_OES_vertex_array_object GL_QCOM_alpha_test GL_QCOM_binning_control GL_QCOM_driver_control GL_QCOM_perfmon_global_mode GL_QCOM_extended_get GL_QCOM_extended_get2 GL_QCOM_tiled_rendering GL_QCOM_writeonly_rendering GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT
03-27 16:00:57.776 12123 12148 D Unity   : _texture_sRGB_decode GL_EXT_texture_filter_anisotropic GL_EXT_multisampled_render_to_texture GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_disjoint_timer_query
03-27 16:00:57.783 12123 12148 D Unity   : OPENGL LOG: Creating OpenGL ES 3.0 graphics device ; Context level  <OpenGL ES 3.0> ; Context handle -1669875648
03-27 16:00:57.786 12123 12148 D Unity   : [EGL] Attaching window :0xaeb78f08
03-27 16:00:57.812 12123 12148 D Unity   : Requested framebuffer: resolution[1080x1920], rgba[8/8/8/8], depth+stencil[on], samples[1]
03-27 16:00:57.812 12123 12148 D Unity   : Created framebuffer: resolution[1080x1920], rgba[8/8/8/8], depth+stencil[24/8], samples[0] 
03-27 16:00:57.813 12123 12148 D Unity   : [EGL] Attaching window :0xaeb78f08
03-27 16:00:57.813 12123 12148 D Unity   : Initialize engine version: 2018.3.2f1 (b3c100a4b73a)
03-27 16:00:57.877 12123 12148 D Unity   : Begin MonoManager ReloadAssembly
03-27 16:00:58.612 12123 12148 D Unity   : - Completed reload, in  0.735 seconds
03-27 16:00:58.895 12123 12148 D Unity   : PlayerInitEngineGraphics OK
03-27 16:00:58.897 12123 12148 D Unity   : Found 27 native sensors
03-27 16:00:58.902 12123 12148 D Unity   : Sensor :        Accelerometer ( 1) ; 0.000595 / 0.00s ; MPU6515 Accelerometer / InvenSense 
03-27 16:00:58.934 12123 12148 D Unity   : Sensor :        Accelerometer ( 1) ; 0.000595 / 0.00s ; MPU6515 Accelerometer / InvenSense 
03-27 16:00:58.939 12123 12148 D Unity   : SetWindow 0 0xaeb79d08
03-27 16:00:58.939 12123 12148 D Unity   : [EGL] Attaching window :0xaeb79d08
03-27 16:00:58.945 12123 12148 D Unity   : ANativeWindow: (1080/1920) RequestedResolution: (0/0) RenderingResolution: (0/0) EGLSurface: (1080/1920)
03-27 16:01:01.066 12123 12148 D Unity   : UnloadTime: 3.116000 ms
03-27 16:01:01.074 12123 12148 D Unity   : UUID: f6b4d9913d777399 => 8febb2bf65a487d61c807d12965ef479
03-27 16:01:07.600 12123 12148 D Unity   : Sensor :        Accelerometer ( 1) ; 0.000595 / 0.00s ; MPU6515 Accelerometer / InvenSense 
03-27 16:01:07.602 12123 12148 D Unity   : Choreographer available: Enabling VSYNC timing```

AppBar如何适配全面屏沉浸式状态栏颜色

在UIWidgets中是否有直接方法设置?
我现在的做法是做一个方法设置状态栏

---设置状态栏方法

using UnityEngine;

public class StatusBar : MonoBehaviour
{
    private static int newStatusBarValue = 1024;
    /// <summary>
    ///  隐藏上方状态栏
    /// </summary>
    public static void Hide()
    {
        #if !UNITY_EDITOR && UNITY_ANDROID
                setStatusBarValue(1024); // WindowManager.LayoutParams.FLAG_FULLSCREEN; change this to 0 if unsatisfied
        #endif
    }

    /// <summary>
    ///  显示上方状态栏
    /// </summary>
    public static void Show()
    {
        #if !UNITY_EDITOR && UNITY_ANDROID
                setStatusBarValue(2048); // WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN
        #endif
    }

    private static void setStatusBarValue(int value)
    {
        newStatusBarValue = value;
        Color statusBarColor = Color.blue;
        using (var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
        {
            using (var activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
            {
                activity.Call("runOnUiThread", new AndroidJavaRunnable(setStatusBarValueInThread));
            }
        }
    }

    private static void setStatusBarValueInThread()
    {
        using (var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
        {
            using (var activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
            {
                using (var window = activity.Call<AndroidJavaObject>("getWindow"))
                {
                    window.Call("setFlags", newStatusBarValue, newStatusBarValue);
                }
            }
        }
    }
}

再Widget Build之前调用

public override Widget build(BuildContext context)
            {
                StatusBar.Show();
                return new MaterialApp
                (
                    home: new Scaffold
                    (
                        appBar: new AppBar
                        (
                            leading: new SafeArea
                            (
                                child: new IconButton
                                (
                                    icon: new Icon(Icons.menu),
                                    tooltip: "Navigation menu",
                                    onPressed: null
                                )
                            ),
.......

每次进入App之后就会就会如下图
1

但是多任务后就会恢复正常
2

有什么办法能够解决这个问题?

Dynamic targetFrameRate.

If no scheduleFrame calls, trigger an event/callback allowing the developer to specify a low framerate.

If there is any scheduleFrame calls, burst it to a high framerate.

Make sure there is a delay / smoothing algorithm so that the framerate is not up and down too frequently.

Paint.StrokeCap behaviour not match to Flutter doc

Environment:
Unity 2018.3.11f1, macOS, UIWidgets commit d73cf41

When drawing lines in AbstractCustomPainter subclass, the behavior of Paint.strokeCap differs from the designated behavior described in the flutter doc, as StrokeCap.round shows a half-painted line cap.

Test Script:

using Unity.UIWidgets.engine;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;

namespace FinGameWorks.Scripts.Views.Test
{
    public class CurveTestPanel : UIWidgetsPanel
    {
        protected override Widget createWidget()
        {
            return new CustomPaint(foregroundPainter:new TestCurveCustomPainter());
        }
    }
    
    public class TestCurveCustomPainter : AbstractCustomPainter
    {
        public override void paint(Canvas canvas, Size size)
        {
            Paint bezierPaint = new Paint
            {
                style = PaintingStyle.stroke, 
                color = Color.black, 
                strokeWidth = 5, 
                strokeCap = StrokeCap.round,
                strokeJoin = StrokeJoin.round
            };
            Path bezierPath = new Path();
            float offset = 60.0f;
            bezierPath.moveTo(10, 10);
            bezierPath.bezierTo(10 + offset,10,size.width - 10 - offset,size.height-10,size.width - 10,size.height-10);

            canvas.drawPath(bezierPath, bezierPaint);
        }

        public override bool shouldRepaint(CustomPainter oldDelegate)
        {
            return true;
        }
    }
}

Test Image:
image

Notice line caps are not rounded.

Readme missing instructions on ...

  1. How to use FontManager to add font. (Font Name not file name as the Family Name)
  2. How to use UIWidgets_DEGUG to enable debug Mode.
  3. How to use Widgets Inspector?

需要UIWidgets框架的UML结构

希望能在文档中提供说明UIWidgets框架的层次结构的UML图或其他信息,初次接触这个框架,很多依赖关系数据流程不清楚,如果能有UML信息,学习起来能快不少。

关于async/await在uiwidgets中的使用

在界面跳转需要异步加载的时候Navigator是否会提供异步方法,目前使用Promise时遇到一些问题,使用如下代码时快速点击界面按钮时通过snackbar返回的数据有误,必须等待上一个snackbar自己消失后再点击才不会出错。

`
using RSG;
using System.Collections;
using System.Collections.Generic;
using Unity.UIWidgets.animation;
using Unity.UIWidgets.engine;
using Unity.UIWidgets.foundation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.painting;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
using UnityEngine;

namespace Utils.Model.Tutorials
{
public class TestWidgets : UIWidgetsPanel
{
protected override Widget createWidget()
{
return new MaterialApp(
title: "页面跳转返回数据",
home: new FirstPage()
);
}
}

public class FirstPage : StatelessWidget
{
    public override Widget build(BuildContext context)
    {
        return new Scaffold(
            appBar:new AppBar(title:new Text("去找东西")),
            body:new RouteButton()
            );
    }
}

public class RouteButton : StatelessWidget
{
    public override Widget build(BuildContext context)
    {
        return new RaisedButton(
            onPressed: () => NavigateToFindLoli(context),
            child: new Text("找一找")
            );
    }

    private void NavigateToFindLoli(BuildContext context)
    {
        var result = Navigator.push(
            context,
            new MaterialPageRoute(builder: localContext => new Loli())
            ).Then(
                arg => 
                {
                    Scaffold.of(context).showSnackBar(new SnackBar(content: new Text($"{arg}")));
                }
            );            
    }
}

public class Loli : StatelessWidget
{
    public override Widget build(BuildContext context)
    {
        return new Scaffold(
                appBar:new AppBar(
                    title:new Text("找到了什么?")
                    ),
                body:new Center(
                    child:new Column(
                        children:new List<Widget>() {
                            new RaisedButton(
                                child:new Text("椅子"),
                                onPressed:() => Navigator.pop(context,"这是椅子")
                                ),
                            new RaisedButton(
                                child:new Text("凳子"),
                                onPressed:() => Navigator.pop(context,"这是凳子")
                                ),
                            new RaisedButton(
                                child:new Text("桌子"),
                                onPressed:() => Navigator.pop(context,"这是桌子")
                                )
                        }
                        )
                    )
            );
    }
}

}
`

建议统一命名风格

目前UIWidgets框架中文件夹名、文件名、命名空间名、类方法名中均出现了命名风格不统一的情况,同类型对象有些是全小写命名,有些是单词首字母大写命名,有些是全大写命名。

建议趁目前框架还没有大范围推广,统一框架的命名风格。

既然作为Unity的扩展,而且使用C#语言,那么命名风格应该遵守Unity和C#的约定。这一框架的灵感来自Flutter,但不应该全部照着Flutter来,应该重点还原其编程**,而不是命名风格。

FloatingActionButton中的Tooltip未正常显示

`public class TestWidgets : UIWidgetsPanel
{
protected override void OnEnable()
{
FontManager.instance.addFont(Resources.Load("MaterialIcons-Regular"), "Material Icons");
base.OnEnable();
}

    protected override Widget createWidget()
    {
        return new MaterialApp(
            title: "Fullter Demo",
            theme: new ThemeData(primaryColor: Colors.deepOrange),
            home: new BottomAppBar_Demo()
            );
    }
}

public class BottomAppBar_Demo : StatefulWidget
{
    public override State createState()
    {
        return new BottomAppBar_DemoState();
    }
}

class BottomAppBar_DemoState : State<BottomAppBar_Demo>
{
    public override Widget build(BuildContext context)
    {
        return new Scaffold(
            floatingActionButton: new FloatingActionButton(
                onPressed: () => { },
                tooltip: "0123456789",
                child: new Icon(Icons.add, color: Colors.deepOrange)
                )
            );
    }
}`

不能正常输入中文(Win10微软拼音输入法)

系统环境:Windows 10 64位专业版
软件环境:Unity 2018.3.5f1
问题描述:新建工程后,直接导入当前版本的UIWidgets包,在附带的测试场景(Samples/UIWidgetSample/TextInput)中,不能使用微软拼音输入法正常输入中文。而且有时候在某个文本框输入中文,不能提交到文本框,但是在点击了其他文本框之后,会将之前输入的内容提交到后点击的那个文本框。

Huge GC allocations

Getting large amounts of GC calls and framerate goes down to 14fps when clicking the hamburger button for the sidebar or the button in the top-right of the App Bar

Profiler

Unity Version: 2018.3.2f1
Device: Nexus 5
Project: MaterialSample

需要支持到unity 2017

看了使用要求,奈何要求unity 2018以上,公司使用的是2017 且不打算升级到2018 -。-

refine Scroll Event

Currently the scrolling from Mouse device is not smooth. It seems it depends on the height of the screen and also the FPS. This need to be fixed.

编辑器下图片刷新显示异常

1.使用Unity.UIWidgets.widgets.Image.file(@"D:\UnityProjects\UIWidgets\Assets\21.jpg")加载图片时,由IDE切换回Editor等待编译完成后,图片未刷新显示,需要手动修改Inspector面板上的任意值才会触发重绘。

2.颜色叠加模式未起作用

3.是否实现了CircleAvatar等常用遮罩

unity版本:2018.3.7 f1
ide: vs2017 community

return new MaterialApp( title: "Welcome to Flutter", home: new Scaffold( appBar: new AppBar( title: new Text("Welcome to Flutter") ), body: new Center( child: new Container( child: Unity.UIWidgets.widgets.Image.file( @"D:\UnityProjects\UIWidgets\Assets\21.jpg", color: Colors.green, colorBlendMode: BlendMode.modulate ), width: 500, height: 400, color: Colors.black ) ) ));

无法用Tab切换输入框

系统环境:Windows 10 64位专业版
软件环境:Unity 2018.3.5f1
问题描述:新建工程后,直接导入当前版本的UIWidgets包,在附带的测试场景(Samples/UIWidgetSample/TextInput)中,发现如下问题:
选中输入框后,按Tab键不能切换输入框,而是会被当前选中的输入框捕获为制表符输入。

希望能有个选项控制输入框是否捕获Tab输入。

UIWidgets cross-platform compatibility

It's not very clear on documentation about the cross-platform compatibility. Can anyone confirm it on below platforms?

  • Mobile - iOS/Android
  • WebGL
  • Standalone - WIn/Mac/Linux
  • Console - Switch / XBox / PS4

升级到 Unity 2019.1.0f1 后代码报错

报错的代码文件:
\Tests\Editor\CanvasAndLayers.cs
报错的代码行:
第71行:this.SetAntiAliasing(4);

扩展方法的命名空间发生了变化,不再是实验性的了。

image
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.