コード例 #1
0
 public void setBosslifeBarUI()
 {
     /* NAO tire a chamada de referencias daqui, pois outras
      * classes referenciam essa classe, as vezes, antes do Awake daqui ser chamado...
      * (estranho, sei, mas testei com os debugs, apenas deixe ;) )*/
     checkReferences();
     bossLifeBar.maxValue = bossHealthManager.GetOriginalHealth();
     bossLifeBar.minValue = 0;
     bossLifeBarFill      = bossLifeBar.transform.GetChild(1).transform.GetChild(0).GetComponent <Image>();
 }
コード例 #2
0
 public void CheckSprite()
 {
     if (bossHealthManager.GetHealth() < Constantes.AVERAGE_HEALTH * bossHealthManager.GetOriginalHealth())
     {
         gameObject.GetComponent <SpriteRenderer>().sprite = bossSprites[1];
     }
     if (bossHealthManager.GetHealth() < Constantes.LOW_HEALTH * bossHealthManager.GetOriginalHealth())
     {
         gameObject.GetComponent <SpriteRenderer>().sprite = bossSprites[2];
     }
 }