mirror of
https://github.com/Steffo99/gravity-fusion.git
synced 2024-11-22 16:24:20 +00:00
23 lines
428 B
C#
23 lines
428 B
C#
|
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) {
|
|||
|
if(cost > 0) {
|
|||
|
text.text = cost.ToString("0");
|
|||
|
}
|
|||
|
else {
|
|||
|
text.text = "";
|
|||
|
}
|
|||
|
}
|
|||
|
}
|