随笔分类 -  lua

摘要:可以把return true 改为 if true then return true end 阅读全文
posted @ 2020-12-11 14:52 流星曳尾 阅读(484) 评论(0) 推荐(0)
摘要:文本中写'<sprite name="%s">%d打开TextMesh Pro->Resources->TMP Settings的属性 Default Sprite Asset设置文件 此文件的Sprite Atlas属性设置图片,此图片中包含所需图片 阅读全文
posted @ 2020-11-18 15:59 流星曳尾 阅读(259) 评论(0) 推荐(0)
摘要:rt 阅读全文
posted @ 2020-10-27 14:13 流星曳尾 阅读(65) 评论(0) 推荐(0)
摘要:a = 5b = {}if type(a) == "number" then print("aa") --aaendif type(b) == "table" then print("bb") --bbend 阅读全文
posted @ 2020-10-26 16:45 流星曳尾 阅读(1736) 评论(0) 推荐(0)
摘要:例子: tab = {[2] = "aaa",[10] = "bbb"}for k,v in pairs(tab) do print(type(k)) print(k..","..v)end --[[ number2,aaanumber10,bbb --]] 阅读全文
posted @ 2020-10-19 16:07 流星曳尾 阅读(120) 评论(0) 推荐(0)
摘要:例子: a = (function(p)return pend)(1)print(a)--1 阅读全文
posted @ 2020-10-16 18:14 流星曳尾 阅读(265) 评论(0) 推荐(0)
摘要:rt 阅读全文
posted @ 2020-10-15 09:52 流星曳尾 阅读(2389) 评论(0) 推荐(0)
摘要:rt 阅读全文
posted @ 2020-10-14 16:40 流星曳尾 阅读(232) 评论(0) 推荐(0)
摘要:(function() 函数体 end)() 例: if 30 > (function() return 10 end)() then print("1")else print("2")end --1 阅读全文
posted @ 2020-10-12 18:12 流星曳尾 阅读(428) 评论(0) 推荐(0)
摘要:rt 阅读全文
posted @ 2020-10-09 15:47 流星曳尾 阅读(293) 评论(0) 推荐(0)
摘要:string.sub(string,i,j) 阅读全文
posted @ 2020-09-30 18:09 流星曳尾 阅读(505) 评论(0) 推荐(0)
摘要:--module.lua module = {} module.num = 13 module.f1 = function (a,b) return a + bend --test.lua require('module') print(module.f1(5,6)) --11 阅读全文
posted @ 2020-09-29 15:09 流星曳尾 阅读(295) 评论(0) 推荐(0)
摘要:tab = {'sss',123,'sswg'} print(table.concat(tab,',')) --sss,123,sswg 阅读全文
posted @ 2020-09-29 14:57 流星曳尾 阅读(450) 评论(0) 推荐(0)
摘要:a = {key = 'ssss',1,2,3} for i=1,5 do print(a[i])end --[[123nilnil--]] print() for i,v in ipairs(a) do print(v)end --[[123--]] print() for k,v in pair 阅读全文
posted @ 2020-09-29 14:34 流星曳尾 阅读(120) 评论(0) 推荐(0)
摘要:print('aaa\'sss\'bbb') --aaa'sss'bbb 阅读全文
posted @ 2020-09-29 14:13 流星曳尾 阅读(1032) 评论(0) 推荐(0)
摘要:a = 3 if not a == 4 then print('1')else print('2')end --2 阅读全文
posted @ 2020-09-29 13:58 流星曳尾 阅读(1050) 评论(0) 推荐(0)
摘要:rt 阅读全文
posted @ 2020-09-29 13:51 流星曳尾 阅读(7553) 评论(0) 推荐(0)