Skip to main content
gamedev.net
🔒 Locked

Lua C# interoperability Problem

Started by Anand Kelkar 0 replies 1.3k views
Original Post
Anand Kelkar
Anand Kelkar
I am using LuaInterface to call c# function from Lua.I am using register function to register C# function and call it from Lua. My requirement is: Implement dialog function in C# which will open a form to take user's input. Call the function from Lua with single lua variables.It will open the C# winform with variable value display in the text box.user can modify the textbox value and click on OK.Form will be closed and function call will be finished.I want that my lua variable should contain the value which is set inside C# function. sample Lua script: myvar1=10 dialog(myvar1) --C# function which will open windows form with one text box --In the windows form user will fill 30 in the textbox and --click ok print(myvar1) --This line should print 30 but it is printing 10
j0mich01
j0mich01
I think you need to return the modified value in the dialog function. So that you would have something like this.

myvar1 = Dialog(myvar1)

I could be wrong but I don't think that the value of myvar1 can be changed in the Dialog function.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.