using UnityEngine; using System.Collections; public class HighScores : MonoBehaviour { public Rect where; private Vector2 scrollPosition; void OnGUI() { var scores = Score.GetScores (); if (scores != null && scores.Length > 0) { GUILayout.BeginArea (where); scrollPosition = GUILayout.BeginScrollView (scrollPosition); for (int i = 0; i < scores.Length; ++i) { GUILayout.BeginHorizontal (GUI.skin.box); GUILayout.Label (scores [i].name); //, GUILayout.Width (where.width * 0.2f)); GUILayout.Label (scores [i].score.ToString ());//, GUILayout.Width (where.width * 0.2f)); GUILayout.Label (scores [i].when.ToString ()); GUILayout.EndHorizontal (); } GUI.EndScrollView (); GUILayout.EndArea (); } } }