Posts

Unity UI Process-Oriented Programming Template for Lua

Image
The template is based on the xLua implementation, and you can learn about xLua if you are not familiar with it.  It is also easy to switch to other Lua thermal solutions. Send the sample address first https://github.com/skylecn/xLua/tree/master/Assets/XLua/Examples/UIFrame The window is as follows The left side of the window is a list, select the items in the list, the content of the current selection will be displayed on the right. The following is a Lua file that implements the window function. Require 'item' -- list items Local ue = CS.UnityEngine --window Panel = { --Awake event --data is a table that contains the UI's gameObject and registered UI components and can also add its own variables Awake = function (data) Data.list = {}; - Save the data of the generated item Local go = ue.Resources.Load('Item') For index=1,3 do Local item = ue.Object.Instantiate(go) Item.transform.parent = data.leftView.transform item.transf...