MerlinVR / UdonSharp

An experimental compiler for compiling C# to Udon assembly
MIT License
678 stars 89 forks source link

UdonSharpBehaviour does not recognize multidim arrays e.g float[*,*] #121

Closed wardd64 closed 3 years ago

wardd64 commented 3 years ago

When using a 2D array, say a float[,] parameter in a UdonSharpBehaviour Udon treats this as a regular array float[] So the line float[,] myArray = new float[10, 20]; Leads to the error CS0029: Cannot implicitly convert type 'float[,]' to 'float[]'

MerlinVR commented 3 years ago

U# does not support multidimensional arrays at the moment, consider using jagged arrays. If it's throwing a CSXXXX error, you likely have some invalid C# code at the line the error points to since U# does not throw CS errors directly.