unity text change percentage
using UnityEngine.UI;
using System.Collections;
public class PlayerHealth : MonoBehaviour
{
public Image PlayerHealthBar;
public Text Fraction;
public Text Percent;
public int maxHealth = 0;
public int curHealth = 0;
// Use this for initialization
void Start ()
{
Fraction.text = curHealth + "/" + maxHealth;
Percent.text = (curHealth/maxHealth) * 100 + "%";
}
// Update is called once per frame
void Update ()
{
}
}