Hello Guest

Author Topic: Set compression editor script  (Read 3724 times)

m4ko

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 75
    • View Profile
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.

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Set compression editor script
« Reply #1 on: October 10, 2013, 05:09:42 pm »
Rebuild should do it. Does changing the compression in the sprite collection editor & committing have any effect?

m4ko

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 75
    • View Profile
Re: Set compression editor script
« Reply #2 on: October 11, 2013, 06:57:23 am »
Yes manually setting the compression and commit works as always. Strange. I will look into specifics on monday.