Add Cover card and implement block

This commit is contained in:
henriquenakashima 2020-09-19 00:55:36 -04:00
parent ba5b890c2a
commit b4dd6c3496
8 changed files with 266 additions and 3 deletions

View file

@ -11,9 +11,12 @@ public class HeroInfoUI : MonoBehaviour
public Image healthBarBgImage;
public Image healthBarFgImage;
public Text hpText;
public GameObject blockGroup;
public Text blockText;
private int renderedHP = -1;
private int renderedMaxHP = -1;
private int renderedBlock = -1;
private Camera mainCamera;
private static Color HIGH_HP_COLOR = new Color(0f, 0.8f, 0f);
@ -56,5 +59,16 @@ public class HeroInfoUI : MonoBehaviour
}
this.hpText.text = "" + hp + " / " + maxHP;
}
int block = this.battleParticipant.GetBlock();
if (this.renderedBlock != block) {
this.renderedBlock = block;
if (block == 0) {
this.blockGroup.SetActive(false);
} else {
this.blockGroup.SetActive(true);
this.blockText.text = "" + block;
}
}
}
}