Hey everyone, I’m with some pretty noobie question here. What I exaclty wanna know is why the print inside this if statement is showed twice when I stop holding the mouse button?
if(Input.GetButtonUp("Fire1")) {
selectUnits(unitSelecionRect);
print("Event ocurred"); // this is showed twice in the console
foreach(gameUnit u in units) {
u.gameObject.renderer.material.color = Color.red;
}
}
The problem is that I need to add the items that the player was selecting to an array, and because the event occur two times, every item is added two times into the array. Why does this happen?