public void GetItem(int selectId) { ItemEvent(selectId); mainSystem.maxSlaves = mainSystem.Items[0].cnt; mainSystem.UpdateSlave(); BuyingPopup.SetActive(false); mainSystem.ErrorPopup("구매에 성공했습니다."); }
public void OnPointerClick(PointerEventData eventData) { if (eventData.button == PointerEventData.InputButton.Left) { if (mainSystem.Works.Count > 0) { clickEvent = Instantiate(Resources.Load("ClickerEffect") as GameObject); ran = Random.Range(1, 101); if (ran <= mainSystem.chief.workCritical && ran != 0) { point = (int)((mainSystem.chief.workPower * 2) * mainSystem.chief.handsCnt); clickEvent.transform.GetChild(0).GetComponent <Text>().text = "크리티컬 +" + point + "!!!"; } else { point = (int)(mainSystem.chief.workPower * mainSystem.chief.handsCnt); clickEvent.transform.GetChild(0).GetComponent <Text>().text = "작업 +" + point; } for (int i = 0; i < mainSystem.Works.Count; i++) { mainSystem.Works[i].workCheckPoint += point / mainSystem.Works.Count; } clickEvent.transform.SetParent(transform); clickEvent.transform.position = eventData.position; ctpm.InnerText(); } else { mainSystem.ErrorPopup("업무가 없어요"); } } }
public void Save() { mainSystem.ErrorPopup("저장을 시작합니다."); mainSystem.PauseSystem(); PlayerPrefs.SetInt("Chief0", (int)mainSystem.chief.workPower); PlayerPrefs.SetInt("Chief1", (int)mainSystem.chief.workCritical); PlayerPrefs.SetInt("Chief2", (int)mainSystem.chief.handsCnt); PlayerPrefs.SetString("CopMoney", mainSystem.GetMoney().ToString()); PlayerPrefs.SetInt("SlaveCnt", mainSystem.Slaves.Count); for (int i = 0; i < mainSystem.Slaves.Count; i++) { PlayerPrefs.SetString("SlaveKey_" + i, mainSystem.Slaves[i].key); PlayerPrefs.SetInt("SlaveStar_" + i, mainSystem.Slaves[i].star); PlayerPrefs.SetString("SlaveName_" + i, mainSystem.Slaves[i].name); PlayerPrefs.SetInt("SlaveHealth_" + i, mainSystem.Slaves[i].health); PlayerPrefs.SetInt("SlaveStress_" + i, (int)mainSystem.Slaves[i].stressBase); PlayerPrefs.SetInt("SlaveLoyal_" + i, (int)mainSystem.Slaves[i].loyaltyBase); PlayerPrefs.SetInt("SlavePay_" + i, mainSystem.Slaves[i].pay); PlayerPrefs.SetInt("SlavePower_" + i, (int)mainSystem.Slaves[i].workPowerBase); PlayerPrefs.SetInt("SlaveTitle_" + i, mainSystem.Slaves[i].titleKey); } PlayerPrefs.SetInt("WorkCnt", mainSystem.Works.Count); for (int i = 0; i < mainSystem.Works.Count; i++) { PlayerPrefs.SetString("WorkKey_" + i, mainSystem.Works[i].key); PlayerPrefs.SetInt("WorkCP_" + i, (int)mainSystem.Works[i].workCheckPoint); } PlayerPrefs.SetInt("ItemCnt", mainSystem.Items.Count); for (int i = 0; i < mainSystem.Items.Count; i++) { PlayerPrefs.SetInt("ItemCnt_" + i, mainSystem.Items[i].cnt); } PlayerPrefs.SetInt("Year", mainSystem.dateManager.year); PlayerPrefs.SetInt("Mon", mainSystem.dateManager.month); PlayerPrefs.SetInt("Day", mainSystem.dateManager.day); PlayerPrefs.SetInt("ChiefPower", (int)mainSystem.chief.workPower); PlayerPrefs.SetInt("ChiefPC", (int)mainSystem.chief.wpCost); PlayerPrefs.SetInt("ChiefCri", (int)mainSystem.chief.workCritical); PlayerPrefs.SetInt("ChiefCC", (int)mainSystem.chief.wcCost); PlayerPrefs.SetInt("ChiefHands", (int)mainSystem.chief.handsCnt); PlayerPrefs.SetInt("ChiefHC", (int)mainSystem.chief.handsCost); mainSystem.RestartSystem(); mainSystem.ErrorPopup("저장을 끝났습니다."); }
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("잔액이 부족합니다."); } }
public void AddTitle() { if (personalTitle) { mainSystem.ErrorPopup("전용 타이틀은 교체가 불가능합니다."); } else { Slave s = mainSystem.Slaves[slavePos]; s.title = Name.text; s.titleKey = this.titleKey; if (s.titleKey != 5002) { s.runAngle = true; } mainSystem.UpdateSlave(); TitleList.enabled = false; TitlePopup.enabled = false; mainSystem.ErrorPopup("타이틀이 적용되었습니다."); } }
public void EventPlayer(int id, bool check, int slaveCnt = 0) { Debug.Log(slaveCnt); switch (id) { case 1: if (check) { mainSystem.ErrorPopup(mainSystem.Slaves[slaveCnt].name + "의 급여가 올랐습니다."); mainSystem.Slaves[slaveCnt].pay += (int)(mainSystem.Slaves[slaveCnt].pay * 0.2); } else { mainSystem.ErrorPopup(mainSystem.Slaves[slaveCnt].name + "의 충성심이 떨어졌습니다."); mainSystem.Slaves[slaveCnt].loyaltyBase -= 10; } break; default: break; } }