Skip to content

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

@Zephni

Description

@Zephni

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions