1
Support / Set compression editor script
« on: October 10, 2013, 03:56:12 pm »
Hi,
I used an editor script to change the compression of specific atlases depending on platform (webplayer compressed, ios uncompressed). The script does not work anymore. Has anything changed with tk2dSpriteCollectionBuilder.Rebuild?
The script is a little messy so here is the outline:
1. Search all *.prefab in directory
2. Load the gameobject (to check if its loadable)
3. GetComponent<tk2dSpriteCollection> to see if the prefab is a sprite collection
4. Set tk2dSpriteCollection.textureCompression to desired compression
5. tk2dSpriteCollectionBuilder.Rebuild(myCollection);
It seems that it does something as the function works through stuff quite a while. However afterwards the collections still show "uncompressed" where they should be "compressed". I think it started to fail working with 2.1.
I tried to look up my original post where I built this script but couldnt find it. Sorry for repost.
I used an editor script to change the compression of specific atlases depending on platform (webplayer compressed, ios uncompressed). The script does not work anymore. Has anything changed with tk2dSpriteCollectionBuilder.Rebuild?
The script is a little messy so here is the outline:
1. Search all *.prefab in directory
2. Load the gameobject (to check if its loadable)
3. GetComponent<tk2dSpriteCollection> to see if the prefab is a sprite collection
4. Set tk2dSpriteCollection.textureCompression to desired compression
5. tk2dSpriteCollectionBuilder.Rebuild(myCollection);
It seems that it does something as the function works through stuff quite a while. However afterwards the collections still show "uncompressed" where they should be "compressed". I think it started to fail working with 2.1.
I tried to look up my original post where I built this script but couldnt find it. Sorry for repost.