diff options
Diffstat (limited to 'GameCode/BlockRechargeUI.cs')
-rw-r--r-- | GameCode/BlockRechargeUI.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/GameCode/BlockRechargeUI.cs b/GameCode/BlockRechargeUI.cs new file mode 100644 index 0000000..d2ad92a --- /dev/null +++ b/GameCode/BlockRechargeUI.cs @@ -0,0 +1,20 @@ +using UnityEngine; +using UnityEngine.UI; + +public class BlockRechargeUI : MonoBehaviour +{ + private Block block; + + private Image img; + + private void Start() + { + img = GetComponentInChildren<Image>(); + block = GetComponentInParent<Block>(); + } + + private void Update() + { + img.fillAmount = block.counter / block.Cooldown(); + } +} |