You need to create your own class which implements IComparer<Vector2>
and then constructor your SortedSet
with it:
SortedSet<Vector2> sorted = new SortedSet<Vector2>(new MyCustomComparer());
Your comparer just needs to implement the single method Compare
:
public class MyCustomComparer : IComparer<Vector2>
{
public int Compare(Vector2 x, Vector2 y)
{
// Return appropriate value here, depending on the sort order you want
}
}