brunomikoski/ScriptableObjectCollection

Custom Folders for Collection Items

mgmhunt opened this issue · 2 comments

Rather than having all SO created under the same named folder, I'd like to have each collection use it's own folder.

That way I can name the SO items without prefix and they are grouped in different folders.

For the moment I've added to top of ScriptableObjectCollection

        public string itemFolderName = "Items";

and line 134 change to

string parentFolderPath = Path.Combine(assetPath, itemFolderName);

which allows me to set custom folder for custom Collections

    public class PlayerGameEventCollection : AtomEventCollection<PlayerGameEvent>
    {
        PlayerGameEventCollection() { itemFolderName = "Player"; }
    }

Not sure whether this will break things - presume SO are found via reference from creation?

I found one more hardcoded "Items" in the ScriptableObjectCollectionUtility which seems to have only one reference from CreateCollectionWizard.cs - so just used via Wizard and can be changed after.

Screen Shot 2024-05-18 at 17 11 26

Yeah this falls a bit more into personal preference, for me every collection has his own folder, so:

Consumables (Folder)

  • ConsumablesCollection (ScriptableObject)
  • Items (Folder)|
    • ConsumableItem1
    • ConsumableItem 2

I think keeping all the collections on the same level can be quite messy and adding a folder name can be a solution, but honestly its not my prefered way

Sure - I just changed so I can edit but the default would still remain 'Items'. Minor! As things build up I'll probably go with your way :)