1
Fork 0
mirror of https://github.com/Steffo99/gravity-fusion.git synced 2024-11-22 16:24:20 +00:00
gravity-fusion/Assets/Components/TextFromBlackHoleMass.cs

22 lines
475 B
C#
Raw Normal View History

2019-10-05 21:50:43 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TextFromBlackHoleMass : MonoBehaviour
{
protected Text text;
public BlackHole blackHole;
protected void Awake() {
text = GetComponent<Text>();
2019-10-06 22:21:35 +00:00
blackHole = GameObject.FindGameObjectWithTag("BlackHole").GetComponent<BlackHole>();
2019-10-05 21:50:43 +00:00
}
protected void Update()
{
text.text = blackHole.Mass.ToString("0");
}
}