You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
672 B
28 lines
672 B
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<Toggle>().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(); |
|
} |
|
}
|
|
|