private void UpdateText(GridItemControl item) { if (gridLayout.HasClickedItem) { var desc = item.ItemDesc; // todo: format description descText.text = $"{desc.name}:\n{desc.desc}"; var prop = desc.properties; var sb = new StringBuilder(32); sb.AppendLine($"金属:{prop[(int)ItemProperty.Metal]} 灵气:{prop[(int)ItemProperty.Spirit]}"); sb.AppendLine($"能量:{prop[(int)ItemProperty.Energy]} 食物:{prop[(int)ItemProperty.Food]}"); if (desc.isExhaust) { sb.AppendLine("消耗品"); } sb.Append(desc.sellPrice >= 0 ? $"售价:{desc.sellPrice} G" : "不可出售"); propText.text = sb.ToString(); } else { descText.text = ""; propText.text = ""; } }
private void UpdateDescText(GridItemControl item) { if (gridLayout.HasClickedItem) { var desc = item.ItemDesc; // todo: format description descText.text = $"{desc.name}:\n{desc.desc}"; } else { descText.text = ""; } }