我怎样才能随机化这组数组而不得到相同的值?我不知道我做得对不对。当它发生变化时,它如何识别价值?
function Start ()
{
if(MasterVar.quiz<10)
{
var englishLecture = [
["Word that tells us about an action","Verb","Noun","Pronoun","a","0"],
["Name of person, place or things","Verb","Noun","Cute","b","0"],
["Select the noun","Swim","Shout","Joe","c","0"],
["There __ a cat","is","was","can","a","0"],
["You __ go home now","can","open","was","a","0"],
["She ___ her breakfast","ate","play","sleep","a","0"],
["Select the verb","John","is","table","b","0"],
["We ___ planning to go to the movies tonight","were","could","can","b","0"],
["What ____ that noise?","Were","Was","Can","b","0"],
["What ___ your name?","are","can","is","c","0"]
];
index = Random.Range(0,englishLecture.length);
while(englishLecture[index][5] == "1")
{
index = Random.Range(0,englishLecture.length);
}
englishLecture[index][5] == "1";
TextGUI = GameObject.FindGameObjectWithTag("Question");
TextGUI.GetComponent(GUIText).text = englishLecture[index][0];
sel1 = englishLecture[index][1];
sel2 = englishLecture[index][2];
sel3 = englishLecture[index][3];
rightAns = englishLecture[index][4];
}
else if(MasterVar.quiz>=10)
{
Application.LoadLevel("Score");
}
}