How would i go about this you can do it on play game but then it reverts of course im just wondering how would you go about doing this as i need to have it done for my character.
The PlayerHealth is expose to use a clone prefab.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class UIManager : MonoBehaviour
{
public PlayerHealth playerHealth;
public Text HealthText;
private static bool UIExists;
// Use this for initialization
void Start()
{
if (!UIExists)
{
UIExists = true;
DontDestroyOnLoad(transform.gameObject);
}
else
{
Destroy(gameObject);
}
}
// Update is called once per frame
void Update()
{
HealthText.text = "" + playerHealth.currentHealth;
}
}