Exemplo n.º 1
0
        private void Update()
        {
            Health health = fighter.GetTarget();

            if (health == null)
            {
                GetComponent <Text>().text = "N/A";
                return;
            }
            GetComponent <Text>().text = String.Format("{0:0}/{1::0}", health.GetHealthPoitns(), health.GetMaxHealthPoints());
        }
Exemplo n.º 2
0
 private void Update()
 {
     GetComponent <Text>().text = String.Format("{0:0}/{1:0}", health.GetHealthPoints(), health.GetMaxHealthPoints());//0:0.0 to change to 1 higher level of precision
 }
Exemplo n.º 3
0
 private void Update()
 {
     GetComponent <Text>().text = String.Format("{0:0}/{1:0}", health.GetHealthPoints(), health.GetMaxHealthPoints());
 }
Exemplo n.º 4
0
        private void Update()
        {
            playerHPText.text = String.Format("PLAYER HP: {0:0} / {1:0}", health.GetCurrentHealthPoints(), health.GetMaxHealthPoints());

            if (fighter.GetTarget() != null && fighter.GetTarget().GetCurrentHealthPoints() != 0f)
            {
                enemyHPText.text = String.Format("ENEMY HP: {0:0} / {1:0}", fighter.GetTarget().GetCurrentHealthPoints(), fighter.GetTarget().GetMaxHealthPoints());
            }
            else
            {
                enemyHPText.text = "";
            }
        }