One cheeky (and really really quick) way to do this without writing complex code is something like this:
1. Write an editor script to print out the GUID of the selected object. Something like this will suffice.
[MenuItem("2D Toolkit/Debug/PrintGUID", false, 99999)]
static void PrintGUID()
{
if (Selection.activeObject == null)
return;
string guid = AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(Selection.activeObject));
Debug.Log(guid);
}
2. Select the sprite collection data (make sure its the data object and not the editor object) object of the source, and print the GUID (save it somewhere). Also note the sprite Id you'll be switching from.
3. Do the same with the sprite collection you want to switch to, and save that somewhere. Likewise, not the sprite Id you'll be switching to.
4. In tk2dSprite.cs, Awake() insert these lines (or something like this anyway)
string sourceGUID = UnityEditor.AssetDatabase.AssetPathToGUID(UnityEditor.AssetDatabase.GetAssetPath(collection));
if (sourceGUID == "source_guid_you_saved" && _spriteId == SOURCE_SPRITE_ID_YOU_SAVED)
{
collection = UnityEditor.AssetDatabase.LoadAssetAtPath(UnityEditor.AssetDatabase.GUIDToAssetPath("dest_guid_you_saved"), typeof(tk2dSpriteCollectionData)) as tk2dSpriteCollectionData;
if (collection == null) Debug.LogError("Don't save this scene.");
_spriteId = DEST_SPRITE_ID_YOU_SAVED;
}
Now load and save all your scenes. Don't forget to remove those lines after you're done.
p.s. to delete a sprite in a sprite collection, get the tk2dSpriteCollection object, find your sprite in texturerefs or textureParams.texture. Once you've found it, set textureRefs = null; textureParams = new tk2dSpriteCollectionDefinition(); After that call tk2dSpriteCollectionBuilder.Rebuild(spritecollection); Same logic to copy it, just insert a new one in both those entries, and copy values from the other before you wipe it. When deleting, never erase an entry, just null it out as described above to retain unique ids.