JavaScript.Array -> C#.List and constructor

Hi Folks!

Time to join this great community. I started working with Unity a couple of weeks ago and was able to find help and tips for any question i had in the forums and wiki.
But now i could need some advice:

I’m trying to invoke the Triangulation-Script from rune in my JavaScript.
In this Script i’ve got an Array of 2D vertices but i fail passing this Array to the Triangulation.cs.

I tried a couple of things. This is what i got right now.

var triangulator : Triangulator = GetComponent("Triangulator");
temp = new Triangulator(vertices2D);
temp.Triangulate();

This one throws error: “type “Triangulator” does not have a visible constructor that matches the argument list (Array)”

Thing is, i dont even know if i call the C# right.

The Triangulator.cs constructor awaits this:

public Triangulator (Vector2[] points) {
    m_points = new List<Vector2>(points);
}

I’m not that familiar with C# so … i could really need a push in the right direction.

Cheers
Vizzart

The C# script expects a built-in array. Try:

temp = new Triangulator(vertices2D.ToBuiltin(Vector2));

For more detailed info:
http://unity3d.com/support/documentation/ScriptReference/Array.html

Works like a charm. Thanks a lot!

(And its even in the docs! Doh!)