"For now, if you destroy all sprites using the sprite collection, and then do Resources.UnloadUnusedAssets(); that should unload all unused spritecollections."
One finding, based on
a tremendous amount of testing on a vast number of iOS devices from 3GS onwards. I have found that it DOES IN FACT (i.e., Unity does in fact), CORRECTLY get rid of the memory from texture memory, when you use TK's UnloadTextures.
This is great news.
(Typically you can not really use UnloadUnusedAssets during gameplay, as it is slooow of course in Unity. So normally that's not really an option, I'd say.)
So in short I have found that
the UnloadTextures approach works really well, perfectly - you can sit there watching the texture memory go up and down - absolutely reliably - in the profiler. (This on iOS anyways - who knows on android!)
-- HOWEVER --: I have found, furthermore, that if you are running up against
the memory limit in iOS, "you're screwed". Say you unload collection "AA". The problem is this: later,
you want to load "AA" again, unity WILL NOT DO IT - essentially a bug or weakness in Unity. (Unity should, at worst, stop everything and do a slow UnloadUnusedAssets and load your new request for you, but it doesn't, you're screwed.) Again this is
only when you're getting memory warnings in iOS. But it's a killer problem because instead of your textures you'll get - black.
(Annoyingly in a way, Unity, I think generally, sort of magics most memory warnings in iOS and does its very best to keep going anyway, that's great but you can get a bit sloppy about texture memory usage when developing for iOS with Unity.)
So anyway, I have found with vast testing that UnloadUnusedAssets works really fantastically, it works perfectly. You can load the collection later again when you need it.
Certainly, any time you have "backgrounds" on a 2D game, this would basically be a must, you could only work this way (you couldn't leave different backgrounds, which are enormous on retina, and relatively enormous even on old phones, hanging around).
I use precisely this code ..
function __specialReleaseTechnique( ccc:tk2dSpriteCollectionData )
{
var mtl:Material;
for ( mtl in ccc.inst.materials )
{
Resources.UnloadAsset( mtl.mainTexture );
}
}