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
2019-10-07 17:50:34 +02:00

22 lines
554 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TextFromBlackHoleMass : MonoBehaviour
{
protected Text text;
protected GameController gameController;
protected void Awake() {
text = GetComponent<Text>();
gameController = GameObject.Find("GameController").GetComponent<GameController>();
}
protected void Update()
{
if(gameController.blackHole == null) return;
text.text = gameController.blackHole.Mass.ToString("0");
}
}