Sign in to follow this  
Kelly G

Lua.registerFunction: many instances

Recommended Posts

Kelly G    358
Just starting with Lua embedded in C# with LuaInterface, and I'm using the tutorial on this very site. So I have a question about Lua.registerFunction. The second parameter is the "Target" ,which is of type object. I presume this is instance for which the member function will be called. So if you say "go()" in Lua it will run "target.go()" in C#. So what if you have multiple instances, each with scripts that can affect local variables. Would you register each instances member seperately? If so, how would you name them in the script? Alternatly, Would you register the functions dynamically when you run the code for each instance? I'm assuming you wouldn't want to have a seperate Lua interpreter instantiated for each one, but maybe that's how it's done. Anyone know?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this