- Home /
Question by
TheFogati · Sep 23, 2018 at 01:58 AM ·
not workingui image
UI image not enabling when I build
In the editor, my image enables normally, but when I build the game, it doesn't work. This the code that enables it:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class WinCounter : MonoBehaviour {
public Image[] vitoriasAzuis;
public Image[] vitoriasVermelhas;
private void Start()
{
vitoriasAzuis = GetComponent<Image[]>();
vitoriasVermelhas = GetComponent<Image[]>();
}
void Update () {
if(GameManager.manager.victoryBlue >= 0 && GameManager.manager.victoryBlue <=5)
{
for(int i = 0; i < GameManager.manager.victoryBlue +1; i++)
{
vitoriasAzuis[i].enabled = true;
}
}
if (GameManager.manager.victoryRed >= 0 && GameManager.manager.victoryRed <= 5)
{
for (int j = 0; j < GameManager.manager.victoryRed +1; j++)
{
vitoriasVermelhas[j].enabled = true;
}
}
}
}
PS: If you don't understand some words, it's because I speak portuguese.
Comment
Your answer
Follow this Question
Related Questions
UI images turn white when entering playmode 1 Answer
What's wrong with the % operator? Simple question. 3 Answers
GUI Button not working...but the the script is correct... 2 Answers
Why isn't my player moving? 1 Answer
infinite runner HELP 1 Answer