Hi guys, i have this script, and debugin logs that show to me that in fact the color image is changing but when i run it it dsent change the color of the inputs.
Please help me!!
Here the code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
public class ValidateLoginButtom : MonoBehaviour
{
[SerializeField] public TMP_InputField UserInput, passWordInput, NewpassWordInput, ConfirmPassWordInput, NewNameInput, NewEmailInput, NewPhone;
[SerializeField] public Button EntrarButton, NextButton, CreateButtom;
[SerializeField] Image emailImage, confirmNewPasswordImage;
public bool emailIsOk, passWordIsOk = false;
private void Update()
{
if (UserInput.text != "" && passWordInput.text != "")
{
EntrarButton.interactable = true;
}
else if (NewpassWordInput.text != "" && ConfirmPassWordInput.text != "" && NewNameInput.text != "" && NewEmailInput.text != "" && NewPhone.text != "" && emailIsOk == true && passWordIsOk == true)
{
NextButton.interactable = true;
}
else
{
NextButton.interactable = false;
EntrarButton.interactable = false;
}
}
public void emailChecker()
{
if (NewEmailInput.text.IndexOf("@") > 0 && NewEmailInput.text.IndexOf(".") > 0)
{
emailIsOk= true;
}
else
{
emailIsOk = false;
emailImage.color = new Color(215, 195, 195, 255);
}
// Debug.Log(emailIsOk);
Debug.Log("the email color is:" + NewEmailInput.image.color);
}
public void passWordChecker()
{
if ( NewpassWordInput.text == ConfirmPassWordInput.text)
{
passWordIsOk = true;
}
else
{
passWordIsOk = false;
confirmNewPasswordImage.color = new Color(215, 195, 195, 255);
}
Debug.Log("the pasword color is:" + ConfirmPassWordInput.image.color);
}
}
the debug log says to me that the color is changing but it still is white.
Help!!! and thank you