1
Fork 0
mirror of https://github.com/Steffo99/beat-td.git synced 2024-11-23 07:44:19 +00:00
beat-td/Assets/Scripts/TextFromCost.cs
2018-04-23 20:09:13 +02:00

22 lines
535 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TextFromCost : MonoBehaviour {
TowerSelector towerSelector;
GameStatus gameStatus;
Text text;
// Use this for initialization
void Start () {
towerSelector = GetComponentInParent<TowerSelector>();
text = GetComponent<Text>();
gameStatus = GetComponentInParent<GameStatus>();
}
void Update () {
text.text = gameStatus.towerCosts[towerSelector.index].ToString();
}
}