Working with a large number of atlased sprites - Editor performance.

I’ve got 4096 sprites I’m adding packing into an atlas using the Unity Sprite Packer but I’m running into some issues.

In the editor I create an array of Sprites (public Sprites[ ] sprites; ) on a GameObject and select the sprites and drag/drop them to populate the array.

Issue: the editor performance is almost unusable when selecting and working with 4096 objects.

How else can I get a list/reference to these sprites at runtime? Remember they’re atlased (and must be) so I can’t simply drop them into Resources and load them that way.

I’ts become a real road block for testing sets of sprites.

Any ideas?

I sometimes use a custom ScriptableObject for referencing Sprites and then reference the ScriptableObject from a script on my GameObject rather than directly referencing lots of Sprites from the script.

You could create a custom “SpriteList” ScriptableObject and create several instances (assets) each referencing a subset of your Sprites and then just reference the actual assets from your script.

Thanks andymads,

Does this solve the problem I have though? I’d still need to populate the list/array in the scriptable object no?

Well you said the problem is with the editor when selecting and working with 4096 objects. It would allow you to work with a subset of this number at a time, e.g. 16 list assets with 256 Sprites each. Your script would reference these 16 assets. Or perhaps I’m not understanding what your issue is?