ScriptableObjectCollection icon indicating copy to clipboard operation
ScriptableObjectCollection copied to clipboard

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

Open max-critcrew opened this issue 11 months ago • 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?

max-critcrew avatar Mar 07 '24 17:03 max-critcrew

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 avatar Mar 07 '24 19:03 brunomikoski

@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 :)

max-critcrew avatar Mar 07 '24 21:03 max-critcrew

Yep! it should be alright!

brunomikoski avatar Mar 07 '24 22:03 brunomikoski