xLua——写UI逻辑

作者:追风剑情 发布于:2017-7-15 17:28 分类:Lua

以下代码来自xLua demo,这里只是做进一步说明。

一、创建lua文件

  1. function start()
  2. print("lua start...")
  3. -- 这里的ButtonUGUI控件
  4. self:GetComponent("Button").onClick:AddListener(function()
  5. print("clicked, you input is '" ..input:GetComponent("InputField").text .."'")
  6. end)
  7. end

工程截图

3333.png

5555.png

运行测试

22222.png

1111.png

标签: xLua

Powered by emlog  蜀ICP备18021003号-1   sitemap

川公网安备 51019002001593号