克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

TinaX Framework - UIKit.

logo

LICENSE 996.icu LICENSE

TinaX是一个简洁、完整、愉快的开箱即用的Unity应用游戏开发框架, 它采用"Unity 包"的形式提供功能。

TinaX.UIKit 为TinaX Framework提供了基于UGUI的UI管理功能

  • 基于“页面”概念的UI管理
  • UI动画框架
  • UGUI功能扩展

package name: io.nekonya.tinax.uikit



QuickStart

UIKit的主要服务接口是:

TinaX.UIKit.IUIKit

主要服务接口的Facade是:

TinaX.VFSKit.UIKit

创建一个“UI页”

1592002008840

在UI页面的根级gameObject上添加组件“XComponent”

1592002172228

并将其设置为“UI处理者”

1592002636484

添加一个ugui的"Text"组件

1592002743469

将其拖进"XComponent"

1592002818818

1592002842123

编写一个 "UIController", (如果你觉得它是MVC结构的话)

using TinaX;
using TinaX.XComponent;
using UnityEngine.UI;

public class MainScreen : XUIBehaviour
{
    [Binding("txt_Text")] //对应"XComponent"中的绑定名称
    public Text txt_title;

    public override async void Start()
    {
        txt_title.text = "Hello World(❁´◡`❁)";
    }
}

然后,打开UI 😜

IUIEntity mainScreen = uikit.OpenUIAsync("mainScreen", new MainScreen());
//对象"uikit" (类型为IUIKit) 可通过依赖注入获得. 或者也可使用facade.

更多用法请 查看文档.



安装

使用OpenUPM安装

# Install openupm-cli if not installed.
npm install -g openupm-cli
# OR yarn global add openupm-cli

#run install in your project root folder
openupm add io.nekonya.tinax.uikit

通过npm安装 (UPM)

修改您的工程中的Packages/manifest.json 文件,并在文件的"dependencies"节点前添加如下内容:

"scopedRegistries": [
    {
        "name": "TinaX",
        "url": "https://registry.npmjs.org",
        "scopes": [
            "io.nekonya"
        ]
    },
    {
        "name": "package.openupm.com",
        "url": "https://package.openupm.com",
        "scopes": [
            "com.cysharp.unitask",
            "com.neuecc.unirx"
        ]
    }
],

如果在进行上述操作后,您仍然未能在"Unity Package Manager"窗口中找到TinaX的相关Packages,您也可以尝试刷新、重启编辑器,或手动添加如下配置到"dependencies":

"io.nekonya.tinax.uikit" : "6.6.3"

通过Git方式安装(UPM)

你可使用如下地址在Unity Package Manager窗口中安装本包:

git://github.com/yomunsam/TinaX.UIKit.git

如果您想手动指定安装某个本本, 您可以使用 release tag, 例如 #6.6.3. 或访问Release页面了解细节: https://github.com/yomunsam/TinaX.VFS/releases

如不指定版本,Unity将会安装当前git仓库中的最新版本,可能会造成兼容性错误。


特殊地区用户指引

由于部分中文开发者居住和生活的地区较为特殊,可能无法以全世界大多数人相同的方式使用互联网。如果在安装时出现问题,可尝试使用如下方式解决:

  • 请尽可能努力以各种方式与全世界大多数人保持同样的网络环境。
  • 尝试使用cnpm镜像,包括UPM方式和OpenUPM方式
  • 使用openupm时,您可按照此处说明尝试使用第三方register
    • 需要说明的是,TinaX的第三方依赖,比如UniRx并没有发布到npmjs.org, 因此在cnpm中也是找不到它的。
  • 如果下载源码遇到困难,可以试试从TinaX在Gitee的镜像下载
  • 可以在同一个项目中使用不同的方式安装处理不同的packages,如你可以使用"Gitee"、"cnpm"等渠道安装TinaX packages,而如果实在下载不下来第三方依赖(如"Unirx")的话,直接给下载下来放在项目的Packages目录里也是可行的。(当然,把所有东西都一股脑扔进Packages目录也是可行的,不过这样可能升级的时候会不方便)



依赖

本项目(包)直接依赖以下包

如果您通过Git方式安装Package,那么您需要手动确保所有依赖项已被安装。如果使用NPM/OpenUPM安装本Package,则所有依赖都将自动被安装。




Learn TinaX

您可以访问TinaX的文档页面来学习了解各个功能的使用


Third-Party

本项目中使用了以下优秀的第三方库:

  • TweenRx : Reactive animation utility for Unity.
Copy Right (c) 2020 Nekonya Studio "Anti 996" License Version 1.0 (Draft) Permission is hereby granted to any individual or legal entity obtaining a copy of this licensed work (including the source code, documentation and/or related items, hereinafter collectively referred to as the "licensed work"), free of charge, to deal with the licensed work for any purpose, including without limitation, the rights to use, reproduce, modify, prepare derivative works of, distribute, publish and sublicense the licensed work, subject to the following conditions: 1. The individual or the legal entity must conspicuously display, without modification, this License and the notice on each redistributed or derivative copy of the Licensed Work. 2. The individual or the legal entity must strictly comply with all applicable laws, regulations, rules and standards of the jurisdiction relating to labor and employment where the individual is physically located or where the individual was born or naturalized; or where the legal entity is registered or is operating (whichever is stricter). In case that the jurisdiction has no such laws, regulations, rules and standards or its laws, regulations, rules and standards are unenforceable, the individual or the legal entity are required to comply with Core International Labor Standards. 3. The individual or the legal entity shall not induce, suggest or force its employee(s), whether full-time or part-time, or its independent contractor(s), in any methods, to agree in oral or written form, to directly or indirectly restrict, weaken or relinquish his or her rights or remedies under such laws, regulations, rules and standards relating to labor and employment as mentioned above, no matter whether such written or oral agreements are enforceable under the laws of the said jurisdiction, nor shall such individual or the legal entity limit, in any methods, the rights of its employee(s) or independent contractor(s) from reporting or complaining to the copyright holder or relevant authorities monitoring the compliance of the license about its violation(s) of the said license. THE LICENSED WORK IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ANY WAY CONNECTION WITH THE LICENSED WORK OR THE USE OR OTHER DEALINGS IN THE LICENSED WORK. ----------------------------------------------------------------------------- MIT License Copyright (c) 2020 Nekonya Studio Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
C#
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化