魔力宝贝

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

[Foreach] Warp

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

Warp
Foreach.Warp(WarpFunction)
函数功能
对所有Warp传送点执行指定函数(WarpFunction)。

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

WarpFunction(CharIndex)
参数说明
CharIndex: 数值型 Warp传送点对象Index。
返回值


参考实例
-- 定义一个WarpFunction
function MyForeachWarp(CharIndex)
  print("MyForeachWarp: "..CharIndex.." called")
  return 0
end

Foreach.Warp(MyForeachWarp); -- 对所有Warp传送点批量执行WarpFunction
回复

使用道具 举报

Archiver|魔力研究社

GMT+8, 2025-5-13 00:44 , Processed in 0.101998 second(s), 23 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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