AutoTextureConvert.cs 498 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEditor;
  5. public class AutoTextureConvert : AssetPostprocessor
  6. {
  7. void OnPreprocessTexture()
  8. {
  9. TextureImporter textureImporter = assetImporter as TextureImporter;
  10. if(textureImporter.textureType == TextureImporterType.Cursor)
  11. {
  12. return;
  13. }
  14. textureImporter.textureType = TextureImporterType.Sprite;
  15. textureImporter.maxTextureSize = 512;
  16. }
  17. }