using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class TextFromUnspentBlackHoleMass : MonoBehaviour { protected Text text; public BlackHole blackHole; protected void Awake() { text = GetComponent(); blackHole = GameObject.FindGameObjectWithTag("BlackHole").GetComponent(); } protected void Update() { text.text = blackHole.UnspentMass.ToString("0"); } }