Advertisement
LittleAngel

MakeGUIImage

May 18th, 2011
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.06 KB | None | 0 0
  1. // MakeGUIImage.js
  2. // PRE-processes all textures that are placed in a folder GUIImages to be set as an uncompressed unchanged GUI Image.
  3. // Place inside the Editor folder, or a sub-folder within.
  4. // v1.01
  5.  
  6.  
  7. class MakeGUIImage extends AssetPostprocessor {
  8. function OnPreprocessTexture () {
  9. // Automatically convert any texture file with "GUIImages" in its file name into an uncompressed unchanged GUI Image.
  10. if (assetPath.Contains("GUI Images") || assetPath.Contains("SpriteFonts") || assetPath.Contains("SpriteAtlases")) {
  11. Debug.Log ("Importing new GUI Image!");
  12. var myTextureImporter : TextureImporter = assetImporter;
  13. myTextureImporter.textureType = TextureImporterType.Advanced;
  14. myTextureImporter.textureFormat = TextureImporterFormat.ARGB32;
  15. myTextureImporter.convertToNormalmap = false;
  16. myTextureImporter.maxTextureSize = 1024;
  17. myTextureImporter.grayscaleToAlpha = false;
  18. myTextureImporter.generateCubemap = TextureImporterGenerateCubemap.None;
  19. myTextureImporter.npotScale = TextureImporterNPOTScale.None;
  20. myTextureImporter.isReadable = true;
  21. myTextureImporter.mipmapEnabled = false;
  22. // myTextureImporter.borderMipmap = false;
  23. // myTextureImporter.correctGamma = false;
  24. myTextureImporter.mipmapFilter = TextureImporterMipFilter.BoxFilter;
  25. myTextureImporter.fadeout = false;
  26. // myTextureImporter.mipmapFadeDistanceStart;
  27. // myTextureImporter.mipmapFadeDistanceEnd;
  28. myTextureImporter.convertToNormalmap = false;
  29. // myTextureImporter.normalmap;
  30. // myTextureImporter.normalmapFilter;
  31. // myTextureImporter.heightmapScale;
  32. myTextureImporter.lightmap = false;
  33. myTextureImporter.ClearPlatformTextureSettings("Web");
  34. myTextureImporter.ClearPlatformTextureSettings("Standalone");
  35. myTextureImporter.ClearPlatformTextureSettings("iPhone");
  36.  
  37. }
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement