Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we make a C# method that "Yield requests" but also returns a value to lua? #310

Open
Zephni opened this issue Aug 14, 2022 · 0 comments

Comments

@Zephni
Copy link

Zephni commented Aug 14, 2022

In the lua script I'd like to be able to call a C# method that not only yields, but also waits for a value, eg:

someVar = someCSMethod('someParameter')

Where "someCSMethod" looks like this (returning a yield request to stop the script...):

image

But then, is it possible to return an actual value to 'someVar' on the coroutine being resumed?

Hope I've explained this well enough, any help will be greatly appreciated :)


Small edit, the only hack I can currently think of for this is making an "extra" function and prepending it to the lua script so we can combine "yielding" from a C# method with returning a value, something like this:

image

It's a bit hacky and undesirable, so the first question still stands :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant