1
Fork 0
mirror of https://github.com/Steffo99/gravity-fusion.git synced 2024-11-25 09:44:19 +00:00
gravity-fusion/Assets/Components/TextFromCost.cs

23 lines
429 B
C#
Raw Normal View History

2019-10-06 22:21:35 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TextFromCost : MonoBehaviour
{
protected Text text;
protected void Awake() {
text = GetComponent<Text>();
}
public void DisplayCost(float cost) {
2019-10-07 11:44:26 +00:00
if(cost >= 0) {
2019-10-06 22:21:35 +00:00
text.text = cost.ToString("0");
}
else {
text.text = "";
}
}
}