出於某種原因,我不能刪除一組對象,即使我檢查它是否是零或不試圖調用方法「removeSelf」(一個零值)
第一件事我想:
if playGroup~=nil then
playGroup:removeSelf()
end
ERROR: Attempt to remove an object that's already been removed from the stage or whose parent/ancestor group has already been removed.
我也試過這樣:
for k,v in pairs(playGroup) do
if k ~= nil then
k:removeSelf()
end
end
ERROR: attempt to call method 'removeSelf' (a nil value)
它給出了一個錯誤:'嘗試索引本地'v'(一個userdata值)' – Orlo