public Dictionary <string, Bonus_Template> Interpert() { if (!ReferenceEquals(bonusDetailLoading, null)) { Dictionary <string, Bonus_Template> bonus_dic = new Dictionary <string, Bonus_Template>(); foreach (KeyValuePair <string, string> line in bonusDetailLoading.textLists) { Bonus_Template bonus = null; string key = line.Key; string value = line.Value; bonus = CreateTemplate(value); if (!ReferenceEquals(bonus, null)) { bonus_dic.Add(bonus.BonusID, bonus); } } if (!ReferenceEquals(bonus_dic, null)) { return(bonus_dic); } } return(null); }
private void CreateBonusCopy(Bonus_Template bonus, float currentValue, float nextValue) { GameObject copy; copy = Instantiate(_template, transform); copy.transform.GetChild(0).GetComponent <Image>().sprite = bonus.BonusIcon; //icon copy.transform.GetChild(1).GetComponent <TMP_Text>().text = bonus.BonusName; //name copy.transform.GetChild(2).GetChild(0).GetComponent <TMP_Text>().text = string.Format("{0:n0} >", currentValue * 100); //current value copy.transform.GetChild(2).GetChild(1).GetComponent <TMP_Text>().text = string.Format("{0:p0}", nextValue); //next value }