public void SelectGunShopItem(WeaponType weaponType) { selectedItem = GetGunShopItem(weaponType); RescaleGunShopItemImage(selectedItem); ShowConfiguredGunShopItemPanel(selectedItem); }
private void RescaleGunShopItemImage(GunShopItem selectedItem) { if (selectedIcon != null) { ScaleSelectedIcon(1f); } selectedIcon = selectedItem.GetButtonImage(); ScaleSelectedIcon(selectedIconScale); }
private void ShowConfiguredGunShopItemPanel(GunShopItem item) { gunShopItemBuyPanel.SetSelectedGunShopItemIcon(weaponCollection.GetWeaponIcon(item.GetWeaponType())); if (item.IsOwned()) { ConfigureWeaponUpgradePanel(item); panelsMenager.OnlyShowWeaponUpgradePanel(); } else { ConfigureBuyPanel(item); panelsMenager.OnlyShowBuyWeaponPanel(); } }
private GunShopItemUpgradeRow[] SetUpGunShopItemUpgradeRows(GunShopItem item) { WeaponStats weaponStats = weaponCollection.GetWeaponStats(item.GetWeaponType()); WeaponStatsUpgradeLevel weaponStatsUpgradeLevel = new WeaponStatsUpgradeLevel(item.GetWeaponType(), weaponStats, weaponStatsProgression); GunShopItemUpgradeRow damageRow = new GunShopItemUpgradeRow(WeaponStatsUpgradeTypeEnum.Damage); damageRow.price = weaponStatsProgression.GetPrice(item.GetWeaponType(), weaponStats, WeaponStatsUpgradeTypeEnum.Damage).ToString(); damageRow.upgradeLevel = weaponStatsUpgradeLevel.GetUpgradeLevel(damageRow.upgradeType); GunShopItemUpgradeRow fireRateRow = new GunShopItemUpgradeRow(WeaponStatsUpgradeTypeEnum.FireRate); fireRateRow.price = weaponStatsProgression.GetPrice(item.GetWeaponType(), weaponStats, fireRateRow.upgradeType).ToString(); fireRateRow.upgradeLevel = weaponStatsUpgradeLevel.GetUpgradeLevel(fireRateRow.upgradeType); GunShopItemUpgradeRow reloadSpeedRow = new GunShopItemUpgradeRow(WeaponStatsUpgradeTypeEnum.ReloadSpeed); reloadSpeedRow.price = weaponStatsProgression.GetPrice(item.GetWeaponType(), weaponStats, reloadSpeedRow.upgradeType).ToString(); reloadSpeedRow.upgradeLevel = weaponStatsUpgradeLevel.GetUpgradeLevel(reloadSpeedRow.upgradeType); return(new GunShopItemUpgradeRow[] { damageRow, fireRateRow, reloadSpeedRow }); }
private void RefreshGunShopItemsIcon(GunShopItem item) { item.GetButtonChildrenImage().color = item.IsOwned() ? ownedGunShopItemButtonImageColor : notOwnedGunShopItemButtonImageColor; }
private void ConfigureBuyPanel(GunShopItem item) { gunShopItemBuyPanel.SetPrice(item.GetPrice()); }
private void ConfigureWeaponUpgradePanel(GunShopItem item) { GunShopItemUpgradeRow[] rows = SetUpGunShopItemUpgradeRows(item); gunShopItemUpgradePanel.RefreshGunShopItemUpgradeRows(rows); }