FindPartsInZoneWithIgnoreList(minPoint,maxPoint,ignoreTable,maxParts)
返回一个数组,数组内容为在指定区域内所有零件类对象,忽略表中的对象。
名称 | 类型 | 描述 |
---|---|---|
minPoint | Vector3 | 构成包围区域的最小点 |
maxPoint | Vector3 | 构成包围区域的最大点 |
ignoreTable | table | 忽略的对象列表 |
maxParts | int | 最大计算数 |
类型 | 描述 |
---|---|
table | 找到的对象列表 |
不停得查找(0,0,0)点到(10,10,10)范围内所有零件,忽略底板和出生点,输出找到的零件的名称。
local function MyUpdate()
local minPoint = Vector3.New(0,0,0)
local maxPoint = Vector3.New(10,10,10)
local ignoreTable = {WorkSpace.新底板,WorkSpace.出生点}
local maxParts = 10
local list = WorkSpace:FindPartsInZoneWithIgnoreList(minPoint,maxPoint,ignoreTable,maxParts)
for k,v in pairs(list) do
printf(v.Name)
v.Color = Vector3.New(255,0,0)
end
end
local function coroutineUpdate()
while true do
coroutine.wait(0.1)
MyUpdate()
end
end
coroutine.start(coroutineUpdate)