Exemple #1
0
    protected void Update()
    {
        if (EntityView != null)
        {
            if (attackText != null)
            {
                if (EntityView.GetAttack() > 0)
                {
                    attackText.text = EntityView.GetAttack().ToString();
                    attackIcon.gameObject.SetActive(true);
                }
                else
                {
                    attackIcon.gameObject.SetActive(false);
                }
            }
            if (healthText != null)
            {
                healthText.text = EntityView.GetHealth().ToString();
            }

            if (shieldIcon != null)
            {
                if (EntityView.GetMaxShields() > 0)
                {
                    shieldIcon.gameObject.SetActive(true);
                }
                else
                {
                    shieldIcon.gameObject.SetActive(false);
                }
            }
            if (ownerTint != null)
            {
                if (IsFriendly)
                {
                    ownerTint.SetColor(friendlyColor, 0.5f);
                }
                else
                {
                    ownerTint.SetColor(enemyColor, 0.5f);
                }
            }

            if (shieldText != null)
            {
                shieldText.text = EntityView.GetShields().ToString();
            }
            if (shields != null)
            {
                shields.Strength = EntityView.GetShields();
            }
        }
    }