What is good way to use ScriptableObject in this case?

If there are many merchants in games, they will have different item sales list.

Then how to consist as ScriptableObject (SO)?

Should I make each trader’s SO one by one? for like VillageTrader SO, CityTrader SO,

And also items case too, should I make different SO one by one match to items? HPPotion SO, SPPotion SO,

And then at Trader’s SO, set public List SaleItems = new List(); and then register each Item SO one by one at Trader SO’s inspector?

Or other good way?

[CreateAssetMenu]
public class TraderValues : ScriptableObject
{
#if UNITY_EDITOR
    [Multiline]
    public string DevDescription = "";
#endif
    public VillageTrader VillageTrader = new VillageTrader();
    public CityTrader CityTrader = new CityTrader();

}
public abstract class TraderGeneral
{
    public string Name;
    protected TraderType Type;
    public string Description;      // 상인 설명
    public List<Item> SaleItems = new List<Item>();  
    public virtual void Setup()
    {        
    }
}
[CreateAssetMenu]
public class ItemValues : ScriptableObject, ISocketable
{
#if UNITY_EDITOR
    [Multiline]
    public string DevDescription = "";
#endif
    public void Show()
    {
    }
    public HpPotion HpPotion = new HpPotion();
    public SpPotion SpPotion = new SpPotion();
}

I’m not sure why you’d need specific CityTrader and VillageTrader objects. The power of Unity’s object model is through the aggregation of components defining what an object is, rather than the class definitions.

Does it have the 4 legged movement and bark component? That’s probably a dog.
Does it have the 4 legged movement and meow component? That’s probably a cat.
But if it has the 4 legged movement, bark and meow components then it’s some fantasy creature.

The point is that you can re-use components to create whatever you want. Let your prefabs define your objects, not your components.

Your “city” trader and your “village” trader can both just have a re-useable Trader component with a list of available items for sale, and you can drag and drop their inventories right in the inspector as you edit your scene. There’s no reason to create specific classes for each one.

It hears make sense. But I still don’t know well how to actually do that.
Like this?

public class TraderValues : ScriptableObject
{
#if UNITY_EDITOR
    [Multiline]
    public string DevDescription = "";
#endif
    //public VillageTrader VillageTrader = new VillageTrader();
    //public CityTrader CityTrader = new CityTrader();
   public List<Item> VillageSaleItems = new List<Item>();
   public List<Item> CitySaleItems = new List<Item>();
}

?

I’m not really sure why you’re defining all of the values on some global TraderValues ScriptableObject.

public class Vendor : MonoBehaviour // <<< MonoBehaviour not ScriptableObject
{
    public List<Item> forSale;

    // buying / selling behaviour logic
}

Then drag and drop the available items in the inspector as you build your game scenes and create different vendor prefabs.

So I am not sure how much scriptableobject is good, so I thought just testing SO.