I’m trying to script a high score table that could be saved in PlayerPrefsX for my game project, but I can’t seem to get the int array that I created for it to even show up in Debug.Log (or anywhere else really) even after creating a test value to see if anything is even being entered. Not even the Inspector shows any indication that anything happened, all of the values show up as 0. Here’s the chunk of code I have for it so far:
var scoreArray = new int[8];
var testScore:int = 1000;
var i:int;
var j:int;
function Start () {
}
function Update () {
for (i = 0; i > 8; i++) //high score check
{
if (testScore > scoreArray*)*
-
{ *
-
for (j = scoreArray.length - 1; j <= i; --j ) //pushes the score values down starting from the slot that testScore ends up*
-
{*
-
scoreArray[j] = scoreArray[j-1];*
-
}*
_ scoreArray = testScore;_
* }*
_ Debug.Log(scoreArray*);
}*_
}
I prefer solutions in JS as that is the language that I have the most experience with.