Answer the question
In order to leave comments, you need to log in
How to set input field color?
Good afternoon. I know that the following code is wrong, because I assign different data types, but I think this code sets out the essence of the issue quite clearly.
It is necessary in the course of work to change the color (normalColor, highlightedColor) of the Input Field depending on the change of the player.
if(player_red == true)
{
for(int i = 0; i < 4; i++)
{
for(int j = 0; j < 4; j++ )
{
var color_field = field[i,j].GetComponent<ColorBlock>();
color_field.normalColor = Color.red;
field[i,j] = color_field;
}
}
}
Answer the question
In order to leave comments, you need to log in
normalColor can be changed through the Image component
inputField.image.color = Color.red;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question