# UIWidgets
[中文](README-ZH.md)
## 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](https://github.com/flutter/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
<div style="text-align: center"><table><tr>
<td style="text-align: center">
<img src="https://connect-prd-cdn.unity.com/20190323/p/images/2a27606f-a2cc-4c9f-9e34-bb39ae64d06c_uiwidgets1.gif" width="200"/>
</td>
<td style="text-align: center">
<img src="https://connect-prd-cdn.unity.com/20190323/p/images/097a7c53-19b3-4e0a-ad27-8ec02506905d_uiwidgets2.gif" width="200" />
</td>
<td style="text-align: center">
<img src="https://connect-prd-cdn.unity.com/20190323/p/images/1f03c1d0-758c-4dde-b3a9-2f5f7216b7d9_uiwidgets3.gif" width="200"/>
</td>
<td style="text-align: center">
<img src="https://connect-prd-cdn.unity.com/20190323/p/images/a8884fbd-9e7c-4bd7-af46-0947e01d01fd_uiwidgets4.gif" width="200"/>
</td>
</tr></table></div>
### 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:
```none
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";
1. Create a UI Canvas in the scene by "GameObject -> UI -> Canvas";
1. 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.
```csharp
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")
)
)
}
);
}
}
}
}
```
1. Save this script and attach it to **Panel 1** as its component.
1. 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..."
1. 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 image1@2.png and image1@3.png 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
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源说明】 基于Unity3D和行为树插件制作的AI足球小游戏源码.zip基于Unity3D和行为树插件制作的AI足球小游戏源码.zip基于Unity3D和行为树插件制作的AI足球小游戏源码.zip基于Unity3D和行为树插件制作的AI足球小游戏源码.zip基于Unity3D和行为树插件制作的AI足球小游戏源码.zip基于Unity3D和行为树插件制作的AI足球小游戏源码.zip基于Unity3D和行为树插件制作的AI足球小游戏源码.zip基于Unity3D和行为树插件制作的AI足球小游戏源码.zip基于Unity3D和行为树插件制作的AI足球小游戏源码.zip 【备注】 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载使用,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
基于Unity3D和行为树插件制作的AI足球小游戏源码.zip (2000个子文件)
MarkerFollow.anim 4KB
MarkerFlee.anim 3KB
MarkerSeek.anim 3KB
MarkerPersue.anim 3KB
MarkerEvade.anim 3KB
ProjectSettings.asset 18KB
NavMesh.asset 12KB
NavMesh.asset 6KB
NavMesh.asset 6KB
InputManager.asset 6KB
EditorUserBuildSettings.asset 5KB
NavMesh.asset 5KB
QualitySettings.asset 5KB
GraphicsSettings.asset 2KB
Physics2DSettings.asset 1KB
NavMeshAreas.asset 1KB
DynamicsManager.asset 1KB
UnityConnectSettings.asset 850B
PresetManager.asset 797B
EditorSettings.asset 622B
TagManager.asset 398B
AudioManager.asset 360B
EditorBuildSettings.asset 344B
VFXManager.asset 273B
TimeManager.asset 195B
NetworkManager.asset 151B
UPRSettings.asset 140B
ClusterInputManager.asset 114B
sharedassets0.assets 15.45MB
sharedassets1.assets 1.41MB
resources.assets 302KB
globalgamemanagers.assets 181KB
decda0d33c37ba4204c4f31f1440eec5.bin 7KB
0fa52e4239be9361c8bef5d170197cd0.bin 7KB
0247b3d74f089910d5547908f41d41e4.bin 6KB
0edff0bfcb8de55de523d8d560e7e3c0.bin 6KB
08e3b8c4f61c1ad44e4a8a7732b70d08.bin 5KB
067a9aa8953bf04bdcef9505edaad138.bin 5KB
d24017118602d0fd8c2ad3dec6b8c0b2.bin 5KB
d2cf6201e8cad3ed04e7ea379ebb9c75.bin 5KB
d53ba4ad694d3aa04ddfeedd89581243.bin 5KB
dd87217756225b19b981ca6dc173782b.bin 5KB
0a4f64ae4e124226e8360028e317cb70.bin 4KB
0ddc218dcb2e90f5c9252fec04970713.bin 4KB
d69935e45d888fd90a1934811e85ae2d.bin 4KB
0b672ef284c6ef80e1663a47e38bfc6d.bin 4KB
02d6f062df1868b5d7ad97f70e395b5f.bin 4KB
d2e8bf32dddaa39a08f2902601729d49.bin 4KB
df0c124416327a342fce2b1103eab433.bin 4KB
03e73f0087a47138ad3693b8af6a079e.bin 4KB
0f5da225a4c66b97d6101b17d1e56ca0.bin 3KB
de0bd882bf8b6387085b90a8f55d8d80.bin 3KB
d23b37258dfc28ed50da66921984b64e.bin 3KB
0a98a48420c382f35b87f0f5fffce67e.bin 3KB
d307d0395368c057788ddffc5c8facc0.bin 3KB
ddd0084940d5f0850712623069cb60b4.bin 3KB
dd857e6257d3cad35eb68491ac7c26e8.bin 3KB
d6dd54df88924cc5e7858282affcbaef.bin 3KB
de8feb19db5896f53262b9f2cc50d3fb.bin 3KB
060e12fc051f9faa25cb4237a751b42b.bin 3KB
d01644686ebbbc30669b002a50ef815c.bin 3KB
00c969dfe8275f65b189e564188986f1.bin 3KB
d3ce898dd5ee97d636cc6d9afd8f13c9.bin 3KB
d835745f087091a45403573e13ffd135.bin 3KB
d96054e9c03784eaee62c5de253595e2.bin 3KB
0e70751e579b09627fc9d0ac49ce1447.bin 3KB
dc0b100f4adf300987075e1cec6fec87.bin 3KB
d04783d73396f0bec27fb359bfd032f6.bin 3KB
0233bcc230c9d903cb98a91030590108.bin 3KB
04ef2954b0ac116e0688d14f25a91744.bin 3KB
0b4baf973198b53f93f49340bbc27542.bin 3KB
080442e02b12cfa728e538ee4dd6f535.bin 3KB
d9835212fa1170c1ee5c895f92cb625b.bin 3KB
08195a1df52baa983ba5ba85b1841f0b.bin 3KB
d7f7674e33c74184dde512669ca38aef.bin 3KB
008d113032b5fa7201b5f528eb6ffb96.bin 3KB
d7d8e146b0e9b05c427bc54aa32d3980.bin 3KB
dd5dc5ea10dc57e39dbb69812fbb02d5.bin 2KB
03db6504dfffce027ed6e7505515e9eb.bin 2KB
0d40e39ec641d35bc2c349bcdc0ff6e9.bin 2KB
d72aa14978399d2165712b1083fe3246.bin 2KB
d5dcdadda97b9229b5fbfdf634ed0bf6.bin 2KB
d8a7161c4962330a815a5fd8cf79f8af.bin 2KB
d54563003692272aeb542c179b95f167.bin 2KB
00b633e043ab68541d3c9b60448d11f0.bin 2KB
da8387992e8e478d83d692893d5aebcc.bin 2KB
de56e581972fd6cd0597af2a72b80b01.bin 2KB
02eb7a3390be91caa44248cd8d9a7ef1.bin 2KB
dfab4f3d4c428e9ce8fecd7412571be8.bin 2KB
d3bc74cf5cc504dd8acda86de7b9bb10.bin 2KB
012d835a5df9440c3f14f7e23c3af484.bin 2KB
d511b206a82701c3ebe6517f987fa18a.bin 2KB
d435e1db05de81648ccfea0184bc2e3e.bin 2KB
d4d2b09d0b5f3e788b518eb8a20e5d6d.bin 2KB
0519402535846ebd89ea0a57c9319346.bin 2KB
0fcd31b1909e2d5540d886ff2c1be086.bin 2KB
02601dfedfdfc624c054c65d66ba1f7f.bin 2KB
d02ed50845b71012fb38a70ab497171e.bin 2KB
d0a22abac7bb99349f96ce85b653c50c.bin 2KB
d5a45248d41e3da7ee540f47d9a12532.bin 2KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
- Dedeleafk2024-02-02资源很赞,希望多一些这类资源。
- individualistloner5132024-01-01资源是宝藏资源,实用也是真的实用,感谢大佬分享~onnx2024-01-24不客气,还有问题直接私信!
onnx
- 粉丝: 9973
- 资源: 5626
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功