array sorting

var date = [“12.04.2011”,“2.04.2011”,“28.04.2011”,“17.04.2011”,“06.04.2011”];
var playerscore = [score1,score2,score3,score4,score5];
var playername = [“mark”,“joby”,“vijay”,“robert”,“paul”];

function OnGUI()
{

System.Array.Sort(playerscore,playername,date);

}

i am trying to sort the highest score .it is working fine i want the player name to corresponding score. i want to sort the score from highest to lowest. but i want the name and date should change according to the score that was sorted.

how to slove this problem. i am new to unity

thanks

Easiest way would be using this method instead

But this will only allow you to sort two arrays like

System.Array.Sort(playerscore, playername)

If you want to sort another array too you would need a more sophisticated approach. (Using an array of class instead of one array per score/name/whatever and implementing ICompareable for it)

Or try this: http://forum.unity3d.com/threads/84647-Sort-several-arrays

Generally I would recommend combining the three bits of data into one utility class with three variables which you then list in an array.

thanks alot