public void SetUpgradeType(UPGRADE_TYPE type) { upgradeType = type; if (upgradeType == UPGRADE_TYPE.MONSTER) { partyInfo = PartyInfoVC.Inst; scrollList.prefabUnit = prefabPartyUnit; FrameScroll.SetActive(true); //선택된 몬스터 Data monsterData = partyInfo.MonsterList[partyInfo.selected_unit_idx]; } else//upgradeType == UPGRADE_TYPE.EQUIPMENT { equipmentInfo = EquipmentInfoManager.Inst; scrollList.prefabUnit = prefabItemUnit; FrameScroll.SetActive(false); //선택된 장비 Data equipmentData = equipmentInfo.EquipmentList[(int)equipmentInfo.GetSelectedMenu()][equipmentInfo.GetUnitIdx()]; InsertEquipmentUpgradeScroll(); } initScrollList(); updateView(); }
public float getUpgradePrice(UPGRADE_TYPE upgrade) { switch (upgrade) { case UPGRADE_TYPE.CLICK_HARVEST: return(plant.upgradeCost); case UPGRADE_TYPE.CLICK_BREW: return(cMaker.upgradeCost); case UPGRADE_TYPE.CLICK_SELL: return(register.upgradeCost); case UPGRADE_TYPE.FARMER_HARVEST: return(farmerManager.harvestUpgradeCost); case UPGRADE_TYPE.FARMER_COST: return(farmerManager.costUpgradeCost); case UPGRADE_TYPE.BARISTA_BREW: return(baristaManager.brewUpgradeCost); case UPGRADE_TYPE.BARISTA_SELL: return(baristaManager.sellUpgradeCost); case UPGRADE_TYPE.BARISTA_COST: return(baristaManager.costUpgradeCost); default: return(-1f); } }
public void Upgrade(UPGRADE_TYPE upgrade) { switch (upgrade) { case UPGRADE_TYPE.CLICK_HARVEST: if (rManager.BuyUpgrade(plant.upgradeCost)) { plant.beansPerClick += 1; plant.upgradeCost *= 2f; if (beanEmitter) { beanEmitter.prefabsPerEmit += 1; } } break; case UPGRADE_TYPE.CLICK_BREW: if (rManager.BuyUpgrade(cMaker.upgradeCost)) { cMaker.coffeePerClick += 1; cMaker.upgradeCost *= 2f; if (coffeeEmitter) { coffeeEmitter.prefabsPerEmit += 1; } } break; case UPGRADE_TYPE.CLICK_SELL: if (rManager.BuyUpgrade(register.upgradeCost)) { register.coffeeSoldPerClick += 1; register.upgradeCost *= 2f; if (moneyEmitter) { moneyEmitter.prefabsPerEmit += 1; } } break; case UPGRADE_TYPE.FARMER_HARVEST: if (rManager.BuyUpgrade(farmerManager.harvestUpgradeCost)) { farmerManager.beanHarvestSpeed = calculateBonus(farmerManager.beanHarvestSpeed); farmerManager.harvestUpgradeCost *= 3f; } break; case UPGRADE_TYPE.FARMER_COST: if (rManager.BuyUpgrade(farmerManager.costUpgradeCost)) { farmerManager.farmerCost = calculateBonus(farmerManager.farmerCost); farmerManager.costUpgradeCost *= 3f; } break; case UPGRADE_TYPE.BARISTA_BREW: if (rManager.BuyUpgrade(baristaManager.brewUpgradeCost)) { baristaManager.coffeeBrewSpeed = calculateBonus(baristaManager.coffeeBrewSpeed); baristaManager.brewUpgradeCost *= 3f; } break; case UPGRADE_TYPE.BARISTA_SELL: if (rManager.BuyUpgrade(baristaManager.sellUpgradeCost)) { baristaManager.coffeeSellSpeed = calculateBonus(baristaManager.coffeeSellSpeed); baristaManager.sellUpgradeCost *= 3f; } break; case UPGRADE_TYPE.BARISTA_COST: if (rManager.BuyUpgrade(baristaManager.costUpgradeCost)) { baristaManager.baristaCost = calculateBonus(baristaManager.baristaCost); baristaManager.costUpgradeCost *= 3f; } break; default: break; } }