daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Apr 18th, 2015 13 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2. using UnityEngine.UI;
  3. using System.Collections;
  4.  
  5. public class PlayerInfo : MonoBehaviour {
  6.  
  7.     public float curHP = 100;
  8.     public float maxHP = 100;
  9.  
  10.     public Image HpImage;
  11.  
  12.     void Start()
  13.     {
  14.         HpImage.fillAmount = curHP / maxHP;
  15.     }
  16.  
  17.     public void CalculationHP()
  18.     {
  19.         curHP -= 5;
  20.         HpImage.fillAmount = curHP / maxHP;
  21.     }
  22. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top