コード例 #1
0
        private void SetHealthText()
        {
            if (health == null)
            {
                GetComponent <Text>().text = "N/A";
                return;
            }

            GetComponent <Text>().text = System.String.Format("{0:0}/{1:0}", health.GetHealthPoints(), health.GetMaxHealth());
        }
コード例 #2
0
        private void Update()
        {
            if (fighter.GetTarget() == null)
            {
                GetComponent <Text>().text = "N/A";
                return;
            }
            Health health = fighter.GetTarget();

            GetComponent <Text>().text = String.Format("{0:0}/{1:0}", health.GetHealthPoints(), health.GetMaxHealthPoints());
        }
コード例 #3
0
        private void Update()
        {
            if (fighter.GetTarget() == null)
            {
                GetComponent <Text>().text = "N/A";
                return;
            }
            Health health = fighter.GetTarget();//deve checar qual o inimigo em cada frame

            GetComponent <Text>().text = String.Format("{0:0}/{1:0}", health.GetHealthPoints(), health.GetMaxHealthPoints());
        }
コード例 #4
0
        private void DisplayHealthValue()
        {
            health = playerFighter.GetTarget();

            if (health == null)
            {
                healthValue.SetText("N/A");
                return;
            }
            healthValue.SetText(String.Format("{0:0}/{1:0} ({2:0}%)", health.GetHealthPoints(), health.GetMaxHealth(), health.GetPercentage()));
        }
コード例 #5
0
        private void Update()
        {
            if (fighter.GetTarget() == null) // if no health information from target
            {
                GetComponent <Text>().text = "not available";
                return;
            }
            // since we use RPG.Combat, we can specify using Resouces to use Health
            Health health = fighter.GetTarget(); // simply our fighter's target, which is also of type Health, GetPercentage gets the actual health v                             v

            GetComponent <Text>().text = String.Format("{0:0.0}%/{1:0}", health.GetHealthPoints(), health.GetMaxHealthPoints());
        }
コード例 #6
0
        void Update()
        {
            if (fighter.GetTarget() == null)
            {
                healthValue.text = "N/A";
                return;
            }

            Health health = fighter.GetTarget();

            healthValue.text = String.Format("{0:0}/{1:0}",
                                             health.GetHealthPoints(), health.GetMaxHealthPoints());
        }
コード例 #7
0
        private void Update()
        {
            if (m_fighter.Target == null)
            {
                m_text.text = "N/A";
                return;
            }

            // Display health percentage and automatically update
            Health health = m_fighter.Target;

            m_text.text = $"{health.GetHealthPoints():0}/{health.GetMaxHealthPoints():0}";
        }
コード例 #8
0
        private void Update()
        {
            Health health = fighter.GetTarget();

            if (health == null)
            {
                GetComponent <Text>().text = String.Format("N/A");
            }
            else
            {
                GetComponent <Text>().text = String.Format("{0:0} / {1:0}", health.GetHealthPoints(), health.GetMaxHealthPoints());
            }
        }
コード例 #9
0
        private void Update()
        {
            enemy = fighter.GetTarget();

            if (enemy == null)
            {
                healthDisplay.text = "N/A";
                return;
            }

            enemyHealth        = enemy.GetComponent <Health>();
            healthDisplay.text = String.Format("{0:0}/{1:0}", enemyHealth.GetHealthPoints(), enemyHealth.GetMaxHealthPoints());
        }
コード例 #10
0
        private void Update()
        {
            Health targetHealth = fighter.GetTarget();

            if (targetHealth != null)
            {
                this.GetComponent <Text>().text = $"{targetHealth.GetHealthPoints():0}/{targetHealth.GetMaxHealthPoints():0}";
            }
            else
            {
                this.GetComponent <Text>().text = "No Target";
            }
        }
コード例 #11
0
        private void Update()
        {
            Health target = fighter.GetTarget();

            if (target == null)
            {
                GetComponent <Text>().text = "N/A";
            }
            else
            {
                GetComponent <Text>().text = String.Format("{0:0}/{1:0}", target.GetHealthPoints(), target.GetMaxHealthPoints());
            }
        }
コード例 #12
0
        private void Update()
        {
            Health health = fighter.GetTarget();

            if (null != health)
            {
                GetComponent <Text>().text = $"{health.GetHealthPoints()} / {health.GetMaxHealthPoints()}";
            }
            else
            {
                GetComponent <Text>().text = "N/A";
            }
        }
コード例 #13
0
        private void Update()
        {
            //bir hedef yoksa
            if (fighter.GetTarget() == null)
            {
                //herhangi bir can değeri gösterme
                GetComponent <Text>().text = "N/A";
                return;
            }
            //hedefin health componentini aldık ve ekranda gösterdik
            Health health = fighter.GetTarget();

            GetComponent <Text>().text = String.Format("{0:0}/{1:0}", health.GetHealthPoints(), health.GetMaxHealthPoints());
        }
コード例 #14
0
        private void Update()
        {
            Health target = fighter.GetTarget();

            if (target != null)
            {
                healthText.text = String.Format("{0:0}/{1:0}", target.GetHealthPoints(), target.GetMaxHealthPoints());
            }

            else
            {
                healthText.text = "N/A";
            }
        }