public static void OnReduceCurrency() { var cost = ShopData.GetCost(ShopData.SelectedShopCell); GameData.ReduceCurrency(cost); ShopData.CheckAvailableBullets(); }
public static void OnHighlightShopCell() { if (ShopData.CurrentShopCell != ShopData.SelectedShopCell) { ShopData.GetCurrentCell().GetComponent <Image>().color = ShopData.HighlightedCellColor; } var bullet = ShopData.GetBulletByCell(ShopData.CurrentShopCell); ShopData.ShowBuyButton(!ShopData.IsAvailableBullet(bullet)); var cost = ShopData.GetCost(ShopData.CurrentShopCell); var buttonState = GameData.IsEnoughCurrency(cost); ShopData.SetBuyButtonState(buttonState, cost.ToString()); }
public static void OnRemoveHighlightShopCell() { if (ShopData.CurrentShopCell != ShopData.SelectedShopCell) { ShopData.GetCurrentCell().GetComponent <Image>().color = ShopData.NonActiveCellColor; } var bullet = ShopData.GetBulletByCell(ShopData.SelectedShopCell); var condition = (ShopData.SelectedShopCell != ShopData.Cells.Unknown) && !ShopData.IsAvailableBullet(bullet); ShopData.ShowBuyButton(condition); var cost = ShopData.GetCost(ShopData.SelectedShopCell); var buttonState = GameData.IsEnoughCurrency(cost); ShopData.SetBuyButtonState(buttonState, cost.ToString()); }