public class Show : MonoBehaviour { private bool isDesc = true; private string strTitle = "ID Name Score Class "; private string strResult = ""; private string name = "Jim"; void OnGUI() { name = GUI.TextField(new Rect(50, 20, 200, 20), name); if (GUI.Button(new Rect(260, 20, 100, 20), "Seacrh")) { strResult = ""; TB_Score result = new TB_ScoreBLL().Get(name); strResult += result.Id + " " + result.Name + " " + result.Score + " " + result.Class + " "; } if(GUI.Button(new Rect(370, 20, 100, 20), "Sort")) { strResult = ""; List<TB_Score> results = (List<TB_Score>)new TB_ScoreBLL().ListAllBySort(isDesc); foreach (TB_Score r in results) { strResult += r.Id + " " + r.Name + " " + r.Score + " " + r.Class + " "; } if (isDesc) { isDesc = false; } else { isDesc = true; } } GUI.Label(new Rect(50, 50, 500, 600), strTitle + strResult); } }