using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class InputSet : MonoBehaviour { public string rightAnswer; public GameObject showObj; private InputField input; // Start is called before the first frame update void Start() { input = this.GetComponent(); input.onValueChanged.AddListener((string content) => { DoRightAction(content); }); } // Update is called once per frame void Update() { } private void DoRightAction(string content) { showObj.SetActive(content == rightAnswer); } }