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 OnSelectShopCell() { ShopData.GetCellByType(ShopData.Cells.Cell_11).GetComponent <Image>().color = ShopData.NonActiveCellColor; ShopData.GetCellByType(ShopData.Cells.Cell_12).GetComponent <Image>().color = ShopData.NonActiveCellColor; ShopData.GetCellByType(ShopData.Cells.Cell_21).GetComponent <Image>().color = ShopData.NonActiveCellColor; ShopData.GetCellByType(ShopData.Cells.Cell_22).GetComponent <Image>().color = ShopData.NonActiveCellColor; ShopData.GetCurrentCell().GetComponent <Image>().color = ShopData.SelectedCellColor; ShopData.SelectedShopCell = ShopData.CurrentShopCell; var bullet = ShopData.GetBulletByCell(ShopData.CurrentShopCell); if (ShopData.IsAvailableBullet(bullet)) { Events.LaunchEvent(Events.Types.SelectCurrentBullet, Scenes.ActiveScene); } }
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()); }