Unity3D-NLua
Unity3D-NLua copied to clipboard
GeneralExtensions.cs causes compile errors
After installing the latest version of kera lua into my project and configuring the player settings list, I can not even compile the project due to these errors:
`Assets/NLua/Extensions/GeneralExtensions.cs(65,36): error CS1501: No overload for method `GetMethods' takes `2' arguments
Assets/NLua/Extensions/GeneralExtensions.cs(66,35): error CS0411: The type arguments for method `System.Linq.Enumerable.Any<TSource>(this System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,bool>)' cannot be inferred from the usage. Try specifying the type arguments explicitly
Assets/NLua/Extensions/GeneralExtensions.cs(114,36): error CS1502: The best overloaded method match for `System.Type.GetMethod(string, System.Reflection.BindingFlags)' has some invalid arguments
Assets/NLua/Extensions/GeneralExtensions.cs(114,36): error CS1503: Argument `#2' cannot convert `System.Reflection.BindingFlags' expression to type `System.Reflection.BindingFlags'
Assets/NLua/Extensions/GeneralExtensions.cs(142,34): error CS1501: No overload for method `GetMethods' takes `2' arguments
Assets/NLua/Extensions/GeneralExtensions.cs(161,78): error CS1501: No overload for method `GetMethods' takes `2' arguments
Assets/NLua/Extensions/GeneralExtensions.cs(165,38): error CS1928: Type `object' does not contain a member `ToArray' and the best extension method overload `System.Linq.Enumerable.ToArray<System.Reflection.MethodInfo>(this System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo>)' has some invalid arguments
Assets/NLua/Extensions/GeneralExtensions.cs(165,38): error CS1929: Extension method instance type `object' cannot be converted to `System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo>'
`
Just as an update the problem was that I was trying to build it for webgl. Trying to build this as either a webgl application or an android application throws either this error or a related 'system.environment' not found error.
I know the author of this asset has stated that his focus is on pc game support, but is there anyway to fix these errors so that I can build and run my game on those platforms?
I ran into the same problem, and I seem to have solved it by deleting the file NLua/Platform/BindFlags.cs.