简体   繁体   中英

LuaInterface - C# Import

I have registered a method for my lua script that requires an enum as the argument. I'm getting an error when I load the script. Do I need to import the namespace of the enum inside lua for it to run, or do I need to do something else?

EDIT: I know you can do:

require 'CLRPackage'
import _namespace_name

However, that seems a bit annoying because most of my lua scripts use enums. Is there a better way?

There is a static method LuaRegistrationHelper.Enumeration<T>(Lua lua) in the LuaInterface source for registering enums, but it's not exposed to the Lua API. You'd have to build LuaInterface yourself and expose this method somehow. You may as well do that, because you'll run into any number of other issues with LuaInterface that you'll have to patch (I did, anyway).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM