logoHourGlass
Foreach.Warp

Foreach.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