魔力宝贝

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz

[Foreach] Item

[复制链接]
发表于 前天 20:27 | 显示全部楼层 |阅读模式

Item
Foreach.Item(ItemFunction)
函数功能
对所有道具对象执行指定函数(ItemFunction)。

参数说明
ItemFunction: 函数型 可执行的lua函数。
返回值
执行成功的次数。 -1为参数错误。

ItemFunction(ItemIndex)
参数说明
ItemIndex: 数值型 道具对象Index,可用Item库进行操作。
返回值


参考实例
-- 定义一个ItemFunction
function MyForeachItem(ItemIndex)
  print("MyForeachItem: "..ItemIndex.." called")
  return 0
end

Foreach.Item(MyForeachItem); -- 对所有Item对象批量执行ItemFunction
回复

使用道具 举报

Archiver|魔力研究社

GMT+8, 2025-5-12 22:08 , Processed in 0.110437 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表