Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.UI;
- using System.Collections;
- public class PlayerInfo : MonoBehaviour {
- public float curHP = 100;
- public float maxHP = 100;
- public Image HpImage;
- void Start()
- {
- HpImage.fillAmount = curHP / maxHP;
- }
- public void CalculationHP()
- {
- curHP -= 5;
- HpImage.fillAmount = curHP / maxHP;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement