예제 #1
0
        private void Update()
        {
            if (healthValue.GetComponent <Fighter>() == null)
            {
                healthValue.text = "N/A";
            }
            if (health.GetComponent <Fighter>().GetTarget() == null)
            {
                healthValue.text = "N/A";
                return;
            }

            healthValue.text = String.Format("{1}/{2} ({0:0})%", health.GetComponent <Fighter>().GetTarget().GetComponent <Health>().getPercentage().ToString(),
                                             health.GetComponent <Fighter>().GetTarget().GetComponent <Health>().getCurrentHP().ToString(),
                                             health.GetComponent <Fighter>().GetTarget().GetComponent <Health>().getMaxHP().ToString());
        }