Beispiel #1
0
        // Update is called once per frame
        void Update()
        {
            txtEnergy.text = AbilityManager.GetEnergy().ToString("f0") + "/" + AbilityManager.GetEnergyFull().ToString("f0");
            float valueX = Mathf.Clamp(AbilityManager.GetEnergy() / AbilityManager.GetEnergyFull() * 200, 4, 200);
            float valueY = Mathf.Min(valueX, 8);

            energyRect.sizeDelta = new Vector2(valueX, valueY);
        }
 void Update()
 {
     energyBar.value = AbilityManager.GetEnergy() / AbilityManager.GetEnergyFull();
     lbEnergy.text   = AbilityManager.GetEnergy().ToString("f0") + "/" + AbilityManager.GetEnergyFull().ToString("f0");
 }