This toolkit has the following features:
1. Provide a resource packaging tool. Because luaframework defaults to packaging the resources in the example, it is not universal, so there is a tool to see in detail in series two.
2. Provides a tool to simplify the process of writing LUA files. According to Luaframework, if you want to add a panel, then you need to write the corresponding controller, View, and modify the three framework of the LUA files, more cumbersome, so there is a tool to improve efficiency.
3. Provide a small UI framework. This framework is designed for hot updates, provides C # and LUA implementations, and regulates the writing of C # code. The advantage is that for a panel, its C # implementation is much more similar to the implementation of LUA, and can be reduced by two development times, such as the following:
using unityengine;using System.collections;public class Mainpanel:uipanelbase {Publ IC UILabel Hplabel; Public UILabel Mplabel; protected override void Awake () {base. Awake (); UIPanelManager.Instance.CreatePanel (Uipanelname.mainpanel, OnCreate); } protected override void OnCreate (Gameobject go) {base. OnCreate (GO); Hplabel = transform. Findchild ("Hplabel"). Getcomponent<uilabel> (); Mplabel = transform. Findchild ("Mplabel"). Getcomponent<uilabel> (); Uieventlistener.get (transform. Findchild ("Button1"). Gameobject). OnClick = Delegate (Gameobject a) {UIPanelManager.Instance.Get Panel (Uipanelname.firstpanel). Open (); }; Uieventlistener.get (transform. Findchild ("Button2"). Gameobject). OnClick = Delegate (Gameobject a) {uipanelmanager.in Stance. Getpanel (Uipanelname.thirdpanel). Open (); }; }}
Require "Common/define" require "logic/uipanelbase" Mainctrl = Uipanelbase:new (); local gameobject;local transform; Local tweener;function mainctrl.new () return mainctrl;endfunction Mainctrl.awake () panelmgr:createpanel (' Main ', mainctrl.oncreate); endfunction mainctrl.oncreate (obj) gameobject = obj; Transform = Obj.transform; Mainctrl.gameobject = obj; Mainctrl.transform = Obj.transform; Mainctrl.hplabel = Transform:findchild ("Hplabel"): Getcomponent (' UILabel '); Mainctrl.mplabel = Transform:findchild ("Mplabel"): Getcomponent (' UILabel '); Uieventlistener.get (Transform:findchild ("Button1"). Gameobject). OnClick = Mainctrl.openfirstpanel; Uieventlistener.get (Transform:findchild ("Button2"). Gameobject). OnClick = Mainctrl.openthirdpanel; Mainctrl:open (); endfunction Mainctrl.openfirstpanel () Ctrlmanager.getctrl (Ctrlnames.first): Open (); endfunction Mainctrl.openthirdpanel () Ctrlmanager.getctrl (Ctrlnames.third): Open (); end
You might think that there are a lot of differences, but don't forget that we can create Lua template files, so that when the C # version is implemented, the LUA version can be implemented more quickly.
Expansion pack:
:
Http://pan.baidu.com/s/1dEZhqpV
[Unity Hot Update]tolua# & Luaframework (10): Extension Toolkit