lua for循环中i不能改变的解决方案
https://blog.csdn.net/Ai102iA/article/details/75371239像unity中可以这样写:
local j = 0;
for i = 0, slotsRoot.transform.childCount - 1 do
local obj = slotsRoot.transform:GetChild(i - j).gameObject;
if string.find(obj.name, 'Reel') == nil then
CS.UnityEngine.GameObject.DestroyImmediate(obj);
j = j + 1;
end
end
页:
[1]