From 993b9cfc2974276c02bbc6577bf31ee909445d3c Mon Sep 17 00:00:00 2001 From: AlvaroCuerva Date: Tue, 28 Apr 2020 11:59:56 +0200 Subject: [PATCH] HITO 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Último bug arreglado: Al coger una batería, la hud ya no se bugea. --- Assets/Scripts/UIManager.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/UIManager.cs b/Assets/Scripts/UIManager.cs index ed4a2d1b..fb75b427 100644 --- a/Assets/Scripts/UIManager.cs +++ b/Assets/Scripts/UIManager.cs @@ -35,21 +35,24 @@ public void masEnergia(int maximo) public void DevuelveEnergia(int energy) { int dif = energy - aux; - if (energy == 7) + if (energy < 8) { for (int i = 0; i < dif; i++) { bat[energy - i - 1].enabled = true; } } - else + else// bateria = 8 { - for (int i = 0; i < dif; i++) { - if ((energy - i - 2) != -1) - bat[energy - i - 2].enabled = true; + for (int i = 0; i < dif; i++) + { + if ((energy - i - 2) != -1) + bat[energy - i - 2].enabled = true; + } + batextra.enabled = true; } - batextra.enabled = true; + } //if (maxbat == 8 ) batextra.enabled = true; }