public void NotifyBtnClicked(ButtonShopTurret btn, GameObject turretToBuild) { buildManager.SetTurretToBuild(turretToBuild); if (lastBtn != null) { lastBtn.ResetColor(); } lastBtn = btn; }
private void InitShop() { foreach (GameObject turretGO in listTurretPrefab) { GameObject btnGO = Instantiate(buttonShopTurretPrefab, transform); ButtonShopTurret button = btnGO.GetComponent <ButtonShopTurret>(); button.InitWith(turretGO, this); listBtn.Add(button); } }