Add Shop system with ShopManager, ShopUI, and ShopSlotUI; implement item purchasing and shop UI functionality
This commit is contained in:
@@ -12,8 +12,31 @@ namespace Inventory
|
||||
public string itemName;
|
||||
[TextArea] public string description;
|
||||
public Sprite icon;
|
||||
public int price;
|
||||
|
||||
public List<IStatModifier> cures = new();
|
||||
public List<IStatModifier> curses = new();
|
||||
|
||||
[Button("Build Description")]
|
||||
private void BuildDescription()
|
||||
{
|
||||
var descriptionBuilder = new System.Text.StringBuilder();
|
||||
foreach (var modifier in cures)
|
||||
{
|
||||
if (descriptionBuilder.Length > 0) descriptionBuilder.Append(", ");
|
||||
|
||||
var desc = $"Cure: {modifier.Description}";
|
||||
descriptionBuilder.Append(desc);
|
||||
}
|
||||
|
||||
foreach (var modifier in curses)
|
||||
{
|
||||
if (descriptionBuilder.Length > 0) descriptionBuilder.Append(", ");
|
||||
var desc = $"Curse: {modifier.Description}";
|
||||
descriptionBuilder.Append(desc);
|
||||
}
|
||||
|
||||
description = descriptionBuilder.ToString();
|
||||
}
|
||||
}
|
||||
}
|
@@ -10,5 +10,6 @@ namespace Inventory
|
||||
[OdinSerialize, TextArea] public string description;
|
||||
[OdinSerialize] public GameObject prefab;
|
||||
[OdinSerialize] public Sprite icon;
|
||||
[OdinSerialize] public int price;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user