Exemple #1
0
        void Update()
        {
            if (fighter.GetTargetHealth() == null)
            {
                GetComponent <Text>().text = " ";
                return;
            }
            Health health = fighter.GetTargetHealth();

            GetComponent <Text>().text = string.Format("{0:0}/{1:0}", health.GetHealth(), health.GetMAxHealth());
        }
Exemple #2
0
        void Update()
        {
            String enemyHealthPercentage = "N/A";

            if (fighter.GetTargetHealth() != null)
            {
                enemyHealthPercentage = fighter.GetTargetHealth().GetPercentageHealth().ToString();
            }

            GetComponent <Text>().text = String.Format("{0:0}%", enemyHealthPercentage);
        }