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

Support LuaMember functions that can return multiple values #105

Open
Foohy opened this issue Feb 19, 2025 · 2 comments
Open

Support LuaMember functions that can return multiple values #105

Foohy opened this issue Feb 19, 2025 · 2 comments

Comments

@Foohy
Copy link

Foohy commented Feb 19, 2025

It would be great to be able to return multiple values back to lua in a LuaMember. As far as I can tell, it's only possible to return multiple values via manually creating a LuaFunction and pushing those values.

Perhaps could use the "out" or "ref" language semantics to declare such a function?

[LuaMember("ToEuler")]
public void ToEuler(out float pitch, out float yaw, out float roll);

Would be exposed to lua as:

pitch, yaw, roll = quat:ToEuler()

Thank you

@Akeit0
Copy link
Contributor

Akeit0 commented Feb 20, 2025

Isn't valuetuple better?

@Foohy
Copy link
Author

Foohy commented Feb 20, 2025

Woops, yeah ValueTuple would be way cleaner than what I suggested with outs

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

2 participants