public void UpgradeSkill(int id, double money) { switch (id) { case 0: if (money >= mainSystem.chief.wpCost) { mainSystem.RemoveMoney(mainSystem.chief.wpCost); mainSystem.chief.workPower++; mainSystem.chief.wpCost = (int)mainSystem.chief.wpCost * 1.1; skills[0].UpdateSkill(mainSystem.chief.wpCost, mainSystem.chief.workPower); } else { mainSystem.ErrorPopup("잔액이 모자랍니다."); } break; case 1: if (money >= mainSystem.chief.wcCost) { mainSystem.RemoveMoney(mainSystem.chief.wcCost); mainSystem.chief.workCritical++; mainSystem.chief.wcCost = (int)mainSystem.chief.wcCost * 1.1; skills[1].UpdateSkill(mainSystem.chief.wcCost, mainSystem.chief.workCritical); } else { mainSystem.ErrorPopup("잔액이 모자랍니다."); } break; case 2: if (money >= mainSystem.chief.handsCost) { mainSystem.RemoveMoney(mainSystem.chief.handsCost); mainSystem.chief.handsCnt++; mainSystem.chief.handsCost = (int)mainSystem.chief.handsCost * 1.1; skills[2].UpdateSkill(mainSystem.chief.handsCost, mainSystem.chief.handsCnt); } else { mainSystem.ErrorPopup("잔액이 모자랍니다."); } break; } }
public void GetItem() { if (mainSystem.GetItem((int)items[selectId].price)) { mainSystem.RemoveMoney((int)items[selectId].price); items[selectId].cnt++; mainSystem.maxSlaves = mainSystem.Items[0].cnt; mainSystem.UpdateSlave(); BuyingPopup.SetActive(false); mainSystem.ErrorPopup("구매에 성공했습니다."); } else { BuyingPopup.SetActive(false); mainSystem.ErrorPopup("잔액이 부족합니다."); } }
static void RemoveMoneyTest() { instance.RemoveMoney(instance.rmoney); }