void Start () {
y_axis = 0;
display_scores = true;
}
void OnGUI(){
if(display_scores){
for(int i = 1; i < level_names.Length; i++){
if(PlayerPrefs.GetInt("DiscoverLevel"+i.ToString()) == 1){
Debug.Log ("Discovered Level#" + i.ToString() + " " + level_names[i-1]);
GUI.Label(new Rect(0, y_axis, 200, 50), ("Level #" + i.ToString() + " " + level_names[i - 1]));
}
else{
Debug.Log ("havent discovered level # " + i.ToString());
GUI.Label(new Rect(0, y_axis, 200, 30), ("havent discovered level # " + i.ToString());
}
y_axis += 40;
}
display_scores = false;
}
}
So this code runs, I get the appropriate debug messages but for some reason the GUI labels are not being drawn onto the screen and I can’t for the life of me figure out why.