コード例 #1
0
    void Update()
    {
        if (hasBeenAttacked)
        {
            hasBeenAttacked = false;

            if (hasArmor)
            {
                armor.UpdateArmorBar();
            }

            UpdateLifeBar();
        }

        lifeBar.transform.LookAt(GameManager.singleton.transform);
    }
コード例 #2
0
    void Start()
    {
        armor           = GetComponent <ArmorSystem>();
        initialLife     = totalLife;
        unitsPerLife    = GameManager.singleton.unitsPerLife;
        lifeBarMaterial = GameManager.singleton.lifeBarMaterial;

        if (armor != null)
        {
            hasArmor = true;
        }

        CreateBar();
        if (hasArmor)
        {
            armor.CreateArmorBar();
            armor.UpdateArmorBar();
        }
    }