public void ShowTechTips(int techId) { ShowTechTip(); ClearTechTipTexts(); Technique t = LoadTxt.GetTech(techId); techTipText [0].text = t.name; techTipButton[0].gameObject.GetComponentInChildren <Text>().text = "Cancel"; techTipButton[1].gameObject.GetComponentInChildren <Text>().text = "Study"; techTipButton [1].interactable = CheckReq(t.req); techTipButton [1].gameObject.name = techId.ToString(); SetTechTipDesc(t); }
void StudyTech() { int techId = int.Parse(techTipButton [1].gameObject.name); Technique t = LoadTxt.GetTech(techId); foreach (int key in t.req.Keys) { _gameData.ConsumeItemInHome(key, t.req [key]); } MoveTechTipPanel(); _floating.CallInFloating(t.name + " Completed!", 0); _logManager.AddLog(t.name + " Completed!", true); LearntTech(t); _studyActions.UpdateStudy(); //Achievement this.gameObject.GetComponent <AchieveActions>().TechUpgrade(); }