public void Setup(Entities.PetItem item) { this.pet = item; if (item != null) { for (int i = 0; i < (int)Param.Count; i++) { var value = item.GetParam((Param)i); var format = "{0}"; if ((Param)i == Param.HP) { format = "HP.{0}"; } else if ((Param)i == Param.MP) { format = "MP.{0}"; } param[i].text = string.Format(format, value.ToString()); } face.GetComponentInChildren <FaceIcon>().Setup(item); //level.text = $"Lv.{item.level}"; powerup.text = $"{item.powerupCount}/{item.level}"; } unitRoot.SetActive(item != null); addRoot.SetActive(item == null); }
/// <summary> /// 削除する /// </summary> /// <param name="pet"></param> public void Remove(PetItem pet) { var index = items.FindIndex(v => v.uniqid == pet.uniqid); if (index != -1) { items.RemoveAt(index); } }
/// <summary> /// 変更する /// </summary> /// <param name="pet"></param> public void Modify(PetItem pet) { var index = items.FindIndex(v => v.uniqid == pet.uniqid); if (index != -1) { items[index] = pet; } else { items.Add(pet); } }
public void Setup(Score type, Entities.PetItem pet, int value) { this.type = type; paramType.text = Entity.Instance.StringTable.Get(type); var powerup = pet.param[(int)type]; if (value != 0) { paramValue.text = $"{powerup + value} (+{value})"; paramValue.color = Color.red; } else { paramValue.text = $"{powerup + value}"; paramValue.color = Color.black; } input.text = $"{value}"; }