How can I make a system for a list of fields of variable type to a scriptable object

I have a serialisable scriptable object called Item which only consists of a field for a list of structs called ItemData.

    [Serializable]
    [CreateAssetMenu(fileName = "item", menuName = "Inventory/Item", order = 1)]
    public class Item : ScriptableObject
    {
        [SerializeField]
        public List<ItemData> data;
    }

I want to make it so that I can add to the list of structs where each struct has an identifier, a way to choose the type of value, and the value itself similar to how the variables work for visual scripting (Example image attached) where I can configure it from the unity editor. But I haven’t been able to figure out or find a way to do it.

    [Serializable]
    public struct ItemData
    {
        // i dont know what goes here
       // eg:
        public string id;
        public Type type;
        public type Value;
    }

9682187--1380734--image_2024-03-05_204702287.png

You can achieve this by creating something like a “ScriptableObject Variable”.

This video shows how:

Nicely implemented by this asset:

This isn’t exactly what I’m looking for. I want to be able to add attributes to an item with different types so, for example, I could add a variable called “name”, with a value whose type is string and stores “Sword”, and then add another variable called “damage”, with a value of type float and stores 100. Like the variables shown in the image however they use visual scripting’s variable system whereas I want my own integrated into a struct for each variable but I also don’t want to make a scriptable object for each variable.

You can do what I suggest in the beginning of this post here: Hesitating between approaches for items/abilities/usables

It will require custom inspector support to be possible. Tools like Odin Inspector can make it work out of the box.

Though however it will work, [SerializeReference] is going to be required.