Lua.registerFunction: many instances

Started by
-1 comments, last by Kelly G 17 years, 1 month ago
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?

This topic is closed to new replies.

Advertisement