Ejemplo n.º 1
0
        public static void OnReduceCurrency()
        {
            var cost = ShopData.GetCost(ShopData.SelectedShopCell);

            GameData.ReduceCurrency(cost);

            ShopData.CheckAvailableBullets();
        }
Ejemplo n.º 2
0
        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());
        }
Ejemplo n.º 3
0
        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());
        }