|
Hi guys, I'm trying to use this function to draw a line on the screen:
I pass in a Vector3[] array but i got a compile error:
what does this mean? Thanks .
(comments are locked)
|
|
The error says that the function has a parameter type of *Vector3[] (pointer to vector3 array). You are passing in a Vector3[] (vector3 array - not a pointer to one). In C#, the signature reads as params Vector3[], which means that you can pass several Vector3s separated by comma, or send a vector3 array. I think this is a design bug in Unity. It seems that the function expects a pointer to an array of Vector3. I am not well versed in JS to know how to obtain a pointer, or if it is even possible to obtain the pointer of an array. Until someone else post a definite answer how to solve this in JS I can present you a workaround with C# code, proxying the call without the params version. Your JS code can then call this instead of Handles. Put this in Standard Assets folder to ensure it compiles before your script.
Then you can use HandlesX.DrawAAPolyLine in a similar fashion, from your JS code.
(comments are locked)
|
|
The error is gone after I passed in the elements of the vector3 array instead of the whole array:
I get the error if I pass in vecArray:
this is the function declaration:
(comments are locked)
|

Could you please post a bit more information? I made a quick repro and I couldn't get this error. I'd like to see your call to DrawAAPolyLine and the definition of the object passed in.
Actually, what happens is that I get the error in JS but not in C#. It is probably due to the params type.