Why aren't my GUI.Labels being drawn?

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.

Well, this isn’t exactly well documented, since the old GUI is going to be abandoned anyway, but OnGUI is drawn across multiple calls per frame, and when you set display_scores to false after the first run through, you prevented subsequent calls to OnGUI from performing.

My advice, either just use the new GUI, or draw your GUI outside of your if condition.