I need to do button that show a password that user input. I tried change a InputType field with button but this only work for Password->Standard no for Standrd->Password.
this is my script for button
{
GameObject NewPasswordInput;
private UIInput passwordInput;
// Use this for initialization
void Start()
{
NewPasswordInput = GameObject.Find("ActuallyPasswordInput");
}
// Update is called once per frame
void Update () {
passwordInput = GameObject.Find("ActuallyPasswordInput").GetComponent<UIInput>();
passwordInput.UpdateLabel();
}
//
public void Cancel()
{
_stateManager.ChangeScreen(ScreenStateEnum.ProfileEdit);
}
//
public void Confirm()
{
_stateManager.ChangeScreen(ScreenStateEnum.ProfileEdit);
}
public void ShowPassword()
{
if (passwordInput.inputType == UIInput.InputType.Standard) {
passwordInput.inputType = UIInput.InputType.Password;
passwordInput.UpdateLabel();
}
if (passwordInput.inputType == UIInput.InputType.Password){
passwordInput.inputType = UIInput.InputType.Standard;
passwordInput.UpdateLabel();
}
}
}