Lua学习笔记(一)

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

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值