- Crafting UI fully functional - Crafting Stat stones and modular equippable items fully functional Notes: - Urgent need for exclusive(auto sorted) inventory for stones only - Something to do with the "trash" modular items instead of just selling - Add new uses for gold besides equipment, preset items will probably be worthless with modular crafting
40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
using UnityEngine;
|
|
|
|
namespace Kryz.CharacterStats.Examples
|
|
{
|
|
[CreateAssetMenu]
|
|
public class Item : ScriptableObject
|
|
{
|
|
public string ItemName;
|
|
public Sprite Icon;
|
|
public int sellPricePlayer;
|
|
public int sellPriceVendor;
|
|
public string description;
|
|
|
|
public static ItemInstance ConvertTemplateIntoInstance(Item template)
|
|
{
|
|
if(template is EquippableItem item)
|
|
{
|
|
return new EquippableItemInstance(item, item.CraftableBase);
|
|
}
|
|
else if(template is HiddenMap map)
|
|
{
|
|
return new HiddenMapInstance(map);
|
|
}
|
|
else if(template is CraftingStatStoneTemplate stone)
|
|
{
|
|
return new CraftingStatStone(stone);
|
|
}
|
|
return new ItemInstance(template);
|
|
}
|
|
public static ItemInstance ConvertTemplateIntoInstance(Item template, int templateIndex)
|
|
{
|
|
if (template is EquippableItem item)
|
|
{
|
|
return new EquippableItemInstance(item, item.CraftableBase);
|
|
}
|
|
return new ItemInstance(template, templateIndex);
|
|
}
|
|
}
|
|
}
|