Closed fusspawn closed 3 years ago
Note. I managed to fix this by just having System.each return ipairs like it does for arrayEnumerator if getEnumerator returns nil. Will submit a patch following some more testing to make sure nothing else breaks.
you can use a method to do this
class LuaHelper
{
public static void ArrayIpairs<T>(T[] array, Action<T> action)
{
/*
[[
for _, v in ipairs(array) do
action(v)
end
]]
*/
}
}
I have external methods that return lua tables Id like to iterate over.
It seem's to generate fairly sane code for the most part.
This will fail because it treats it as a .NET table and starts looking for an Enumerator due to the generated System.each that clearly wont exist on a native lua table. How do I work around this? Is it possible to trick CSharp lua into using pairs() around native tables instead of System.each