brunomikoski/ScriptableObjectCollection

Question: How to use it for subclasses of Tile/TileBase?

max-critcrew opened this issue · 3 comments

Hey!

First of all: Thanks for the awesome project. We're currently testing everything and from what I can tell so far, all CollectionItems have to inherit from ScriptableObjectCollectionItem.

What if you want/need to make a collection of TileBase/Tile-subclasses (or any other already existing ScriptableObject class)?
Would that be possible?

Hey @max-critcrew !

Yes, since a couple of versions ago I made easy to implement something like that using the interface ISOCItem, you can pretty much copy the same implementation on the ScriptableObjectCollectionItem and just support whatever you want from it.

So you can make yoiur TileBase : ScriptableObject, ISOCItem

@brunomikoski Thanks so much for the fast response!!
That sounds great! Just to clarify, TileBase is a class that inherits from Scriptable object that is part of the unity Tilemap package.

So if I get you correctly, what we can do is to make a custom:

class CustomTile : TileBase, ISOCItem
{
}

And this would be fully compatible, right?
Again thanks so much for your time, it's much appreciated :)

Yep! it should be alright!