Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class Health : MonoBehaviour
- {
- private static float _health;
- private static float maxHealth = 100f;
- public Slider healthSlider;
- void Start()
- {
- _health = maxHealth;
- healthSlider.maxValue = maxHealth;
- healthSlider.minValue = 0f;
- }
- void Update()
- {
- _health = KnightCntrl.health;
- healthSlider.value = _health;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement