I have 4 buttons and they each flash when the button is pressed. However if you were to press a button, then while the button is darker (flashing) click another one, that button then stays dark. I want to reset the color of the sprite before disabling them however it's not working. When the buttons are pressed they no longer flash....
Here is the code:
void Start () {
easy.GetComponent<SpriteRenderer>().color = color;
}
void Update () {
if(difficultySelected[0] == true){
enemyBehavior.shotsPerSecond = 0.2f;
//Enabling the selected button
easy.enabled = true;
//Reseting the colors
normal.GetComponent<SpriteRenderer>().color = color;
hard.GetComponent<SpriteRenderer>().color = color;
expert.GetComponent<SpriteRenderer>().color = color;
//Disabling the 'unselected' buttons
normal.enabled = false;
hard.enabled = false;
expert.enabled = false;
easy.Play("Difficulty");
}else if(difficultySelected[1] == true){
enemyBehavior.shotsPerSecond = 0.5f;
normal.enabled = true;
easy.GetComponent<SpriteRenderer>().color = color;
hard.GetComponent<SpriteRenderer>().color = color;
expert.GetComponent<SpriteRenderer>().color = color;
easy.enabled = false;
hard.enabled = false;
expert.enabled = false;
normal.Play("Difficulty");
}else if(difficultySelected[2] == true){
enemyBehavior.shotsPerSecond = 1;
hard.enabled = true;