IsZoneEmptyWithIgnoreList(minPoint,maxPoint, ignoreTable)
返回一个bool,说明给定数据类型/区域中是否没有零件类对象。
名称 | 类型 | 描述 |
---|---|---|
minPoint | Vector3 | 构成包围区域的最小点 |
maxPoint | Vector3 | 构成包围区域的最大点 |
ignoreTable | table | 要忽略的对象列表 |
类型 | 描述 |
---|---|
bool | 查找区域中是否有零件对象,true为没有零件 |
不停得查找(0,0,0)点到(5,5,5)范围内是否有零件。
local function MyUpdate()
local minPoint = Vector3.New(0,0,0)
local maxPoint = Vector3.New(5,5,5)
local ignoreTable = {WorkSpace.新底板,WorkSpace.出生点}
local bool = WorkSpace:IsZoneEmptyWithIgnoreList(minPoint,maxPoint,ignoreTable)
if bool then
WorkSpace.出生点.Color = Vector3.New(255,0,0)--如果没找到零件则将出生点颜色改为红色
else
WorkSpace.出生点.Color = Vector3.New(0,255,0)--如果找到零件则将出生点颜色改为绿色
end
end
local function coroutineUpdate()
while true do
coroutine.wait(0.1)
MyUpdate()
end
end
coroutine.start(coroutineUpdate)