using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class compare : MonoBehaviour { public InputField n1, n2; public Button b1; public Text t1; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public void show() { if (int.Parse(n1.text) > int.Parse(n2.text)) { t1.text = "大於"; } else if (int.Parse(n1.text) < int.Parse(n2.text)) { t1.text = "小於"; } else { t1.text = "等於"; } } }