using System.Collections; using System.Collections.Generic; using UnityEngine; public class script1 : MonoBehaviour { int score; string dt; void Start() { } void Update() { score = 95; dt = System.DateTime.Now.ToString(); } void OnGUI() { GUI.Box(new Rect(5, 5, 400, 200), "公佈欄"); GUI.Label(new Rect(15, 50, 100, 30), "你的成績 = "); GUI.TextField(new Rect(120, 50, 150, 30), score.ToString()); GUI.Label(new Rect(15, 100, 100, 30), "現在日期時間 = "); GUI.TextField(new Rect(120, 100, 150, 30), dt); } }