void OnGUI() { int oldIndex = index; Rect position = new Rect(0, 0, 180, Screen.height); index = DrawList(position, index, blockSetList, ref scrollPosition); if (index != oldIndex) { viewer.SetBlockSet(blockSetList[index]); } GUILayout.BeginArea(new Rect(0, 0, Screen.width, Screen.height)); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Back")) { Application.LoadLevel("MainMenu"); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.EndArea(); }
void Start() { viewer = GetComponent <BlockSetViewer>(); viewer.SetBlockSet(blockSetList[index]); }