| | |
| | | public class EndlessTowerGridOpen : MonoBehaviour |
| | | { |
| | | // 当前Button对应的Cash Text数据 |
| | | public TextMeshProUGUI cashText; |
| | | public TextMeshPro cashText; |
| | | |
| | | // 当前Button对应的image. |
| | | public Image mImage; |
| | |
| | | cashText.color = new Color(0.5f, 0.5f, 0.5f); |
| | | } |
| | | |
| | | public void SetBuyBtnInfo(int x, int y, TowerPlacementGridEndless tpg) |
| | | public void SetBuyBtnInfo(int x, int y, TowerPlacementGridEndless tpg, string cost) |
| | | { |
| | | gridX = x; |
| | | gridY = y; |
| | | towerGrid = tpg; |
| | | |
| | | TowerDefense.UI.HUD.PlacementTile tile = TowerPlacementGridEndless.instance.GetOneTile(x, y); |
| | | if (tile != null && tile.BuyMesh != null) |
| | | { |
| | | //cashText.gameObject.SetActive(false); |
| | | Transform ts = tile.BuyMesh.transform.Find("CashText"); |
| | | cashText = ts.GetComponent<TextMeshPro>(); |
| | | } |
| | | |
| | | cashText.SetText(cost); |
| | | |
| | | } |
| | | |
| | | /// <summary> |