UdonSharp icon indicating copy to clipboard operation
UdonSharp copied to clipboard

Add support for Tuples

Open Fracas42 opened this issue 2 years ago • 2 comments

Feature Description: It would be useful to allow support for tuples as they allow better readability than using an object array.

For reference of what I'm talking about exactly: https://learn.microsoft.com/fr-fr/dotnet/csharp/language-reference/builtin-types/value-tuples

Fracas42 avatar Sep 21 '22 20:09 Fracas42

I'd like to just append deconstruction onto this request https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/functional/deconstruct

synergiance avatar Nov 07 '22 18:11 synergiance

User defined value types don't really work in Udon at all currently. It'd just incur a massive overhead any time you attempted to use them because they'd need to fake all of the copy by value behavior and do heap allocations in the process. It's likely you'd see https://learn.microsoft.com/en-us/dotnet/api/system.tuple-2?view=net-7.0 and its other variants first.

MerlinVR avatar Nov 07 '22 18:11 MerlinVR