1、插入操作
quality插入qualityList这个Table里面
table.insert(qualityList,quality)
2、清除操作
--存入超过30个进行清除操作
if #v2PosList > 30 then
table.remove(qualityList,1)
end
3、二维数组
--多阶段
local stateTempInfo = entity:FindDynamicComp("@State")
if stateTempInfo ~= nil then
local index = stateTempInfo:Get("Index")
if index > maxSateIndex then
maxSateIndex = index --拿到最大值的index
end
table.insert(stateTempList,entity)
return true
end
-- 将获取眨眼多阶段的entity 存入二维数组
local function SortEntity()
for i=1,maxSateIndex do
stateList[i] = {}
end
for i = 1 , #stateTempList do
local stateInfo = stateTempList[i]:FindDynamicComp("@State")
local index = stateInfo:Get("Index")
table.insert(stateList[index],stateTempList[i])
end
end
--验证拿到的实体对象信息是否正确
--二维数组,遍历输出所有序列帧动画分组
for i = 1 ,maxSateIndex do
for j = 1,#stateList[i] do
print("拿到的眨眼多阶段信息为"..i,stateList[i][j]:GetName())
end
end