Category system ScriptableObject

Hey all i need help with script. I am trying to do a database of categories and subcategories. In interface is everything ok, but in concret class i have tried a lot of things without succes. I need give name to list of strings and in simple editor add subcategories in list. Can someone write me here commented solution? Thanks a lot.

edit: and give me link for some reaserch so i can learn more in this way

I’m not entirely sure what you are trying to do exactly but if I needed a database I would usually do something like

public class MyScriptableObj : ScriptableObject{
    [System.Serializable]
    public class NamedListBlock{
        public string listName = ""
        public List<string> theList = new List<string>();

        public NamedListBlock(string listName, List<string> theList){
            this.listName = listName;
            this.theList = theList;
        }
    }

    pubic List<NamedListBlock> namedLists = new List<NamedListBlock>();

}

Thanks a lot, now i see where was problem :slight_smile:

Did you miss [System.Serializable]? LOL I do that all time.

Yes… its always like that. A litle problem but you are always finding solution for it where you dont need it…

1 Like