using System.Collections; using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; [RequireComponent(typeof(Toggle))] public class PasswordChangeShowMode : MonoBehaviour { public TMP_InputField passwordInput; void Start() { GetComponent().onValueChanged.AddListener(selectChanged); } private void selectChanged(bool Ison) { if (Ison) { passwordInput.contentType = TMP_InputField.ContentType.Standard; } else { passwordInput.contentType = TMP_InputField.ContentType.Password; } passwordInput.ForceLabelUpdate(); } }