Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // MakeGUIImage.js
- // PRE-processes all textures that are placed in a folder GUIImages to be set as an uncompressed unchanged GUI Image.
- // Place inside the Editor folder, or a sub-folder within.
- // v1.01
- class MakeGUIImage extends AssetPostprocessor {
- function OnPreprocessTexture () {
- // Automatically convert any texture file with "GUIImages" in its file name into an uncompressed unchanged GUI Image.
- if (assetPath.Contains("GUI Images") || assetPath.Contains("SpriteFonts") || assetPath.Contains("SpriteAtlases")) {
- Debug.Log ("Importing new GUI Image!");
- var myTextureImporter : TextureImporter = assetImporter;
- myTextureImporter.textureType = TextureImporterType.Advanced;
- myTextureImporter.textureFormat = TextureImporterFormat.ARGB32;
- myTextureImporter.convertToNormalmap = false;
- myTextureImporter.maxTextureSize = 1024;
- myTextureImporter.grayscaleToAlpha = false;
- myTextureImporter.generateCubemap = TextureImporterGenerateCubemap.None;
- myTextureImporter.npotScale = TextureImporterNPOTScale.None;
- myTextureImporter.isReadable = true;
- myTextureImporter.mipmapEnabled = false;
- // myTextureImporter.borderMipmap = false;
- // myTextureImporter.correctGamma = false;
- myTextureImporter.mipmapFilter = TextureImporterMipFilter.BoxFilter;
- myTextureImporter.fadeout = false;
- // myTextureImporter.mipmapFadeDistanceStart;
- // myTextureImporter.mipmapFadeDistanceEnd;
- myTextureImporter.convertToNormalmap = false;
- // myTextureImporter.normalmap;
- // myTextureImporter.normalmapFilter;
- // myTextureImporter.heightmapScale;
- myTextureImporter.lightmap = false;
- myTextureImporter.ClearPlatformTextureSettings("Web");
- myTextureImporter.ClearPlatformTextureSettings("Standalone");
- myTextureImporter.ClearPlatformTextureSettings("iPhone");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement