GithubHelp home page GithubHelp logo

ly774508966 / quick_uicode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zs9024/quick_uicode

0.0 0.0 0.0 433 KB

generate unity ui code quickly by editor(通过编辑器快速生成ui代码)

C# 98.07% Lua 1.93%

quick_uicode's Introduction

quick_uicode

介绍

一个快速自动生成ui代码的编辑器工具,解除繁琐的ui控件查找赋值和事件注册,包括c#和lua两种语言,lua框架基于tolua#(暂未包含进工程)。
配合使用psd2ugui工具 https://github.com/zs9024/quick_psd2ugui ,让做ui更简单。
其中编辑器中列表的序列化使用了第三方开源的序列化工具reorderble-list: https://github.com/rotorz/unity3d-reorderable-list
unity测试版本:5.3.3f1

效果

旋转效果1

使用

由于每个项目的ui系统都不相同,目前只实现了通用的变量声明,查找赋值,事件注册等功能,如需支持自己的ui框架,需自行修改生成脚本的代码。后续可能会添加定制功能

界面结构

  • 使用过程按从左到右,从上到下的顺序。
  • 左半部分用来加载待处理ui,查找和筛选需要的控件。另外单独出来一个gameobject类型的“其他ui对象”,是为了某些情况可以做整体的隐藏显示或克隆操作。
  • 右半部分用来生成代码,并且如果选择脚本继承monobehavior,还可以通过按钮挂载脚本到ui上。
  • “绑定ui”操作即自动完成在inspector面板拖动控件赋值的操作,所以和“变量赋值”操作二选一即可。

操作提示

  • “选择待处理ui”处拖入ui面板
  • 点击“查找ui控件”按钮,会显示控件列表,点击列表元素可定位到ui的相应节点,通过“+”“-”号分别添加和剔除控件
  • “其他ui对象”列表需自行添加
  • 注册事件时,可筛选指定的某些类型,未勾选的控件不会生成事件代码
  • 如果不想生成脚本可选择复制代码,将查找或事件注册代码拷贝至自己项目
  • 可参考demo场景,codepanel.cs,codepanel.lua

quick_uicode's People

Contributors

zs9024 avatar

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.