- 博客(8)
- 资源 (1)
- 收藏
- 关注
原创 LuaTable
-- 注意:-- 1、所有参数带hashtable的函数,将把table当做哈希表对待-- 2、所有参数带array的函数,将把table当做可空值数组对待-- 3、所有参数带tb的函数,对表通用,不管是哈希表还是数组--[[数组]]-- 计算数组长度---@param array table---@return numberfunction table.length(arra...
2019-07-01 10:16:39
684
原创 LuaString
function string.widthSingle(inputstr) -- 计算字符串宽度 -- 可以计算出字符宽度,用于显示使用 local lenInByte = #inputstr local width = 0 local i = 1 while (i<=lenInByte) do local curBy...
2019-07-01 10:13:36
294
原创 LuaQueue
---@class QueueQueue = class()function Queue:ctor() self.first = 0 self.last = -1 self.n = 0endfunction Queue:Lpush(value) local first = self.first - 1 self.first = first ...
2019-07-01 10:12:41
227
原创 LuaMath
function math.IsEvenNumber(num) local num1,num2=math.modf(num/2)--返回整数和小数部分 if(num2==0)then return true else return false endendfunction math.Clamp(v, max, min) ...
2019-07-01 10:01:34
240
原创 LuaList
---@class ListList = class()function List:ctor()endfunction List:Add(item) table.insert(self, item)endfunction List:Clear() local count = self:Count() for i=count,1,-1 do ...
2019-07-01 09:57:42
316
原创 LuaEnum
---@class EnumEnum = {}---@param enum table---@param enumVal numberfunction Enum.ToString(enum, enumVal) for k, v in pairs(enum) do if v == enumVal then return tostring(k...
2019-07-01 09:55:29
453
原创 LuaDictionary
---@class DictionaryDictionary = class()function Dictionary:ctor() self.keyList = {}endfunction Dictionary:Add(key, value) if self[key] == nil then self[key] = value tab...
2019-07-01 09:54:29
415
原创 LuaClass
--保存类类型的虚表local _class = {}-- 自定义类型ClassType ={ class = 1, instance = 2,}function isA(class_type_child, class_type_parent) local now_super = class_type_child while now_super ~...
2019-07-01 09:18:07
162
HolographicAcademy-Unity5.6可以使用
2018-05-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人