Created
May 30, 2020 19:53
-
-
Save renaudbedard/babef2fc87fb474519ad42b7df54b190 to your computer and use it in GitHub Desktop.
Import Remapping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AstcImporterMapper : AssetPostprocessor | |
{ | |
private void OnPreprocessTexture() | |
{ | |
// TODO: this should be using the TextureImporterConfiguration | |
if (assetPath.Contains("_XXXY") || assetPath.Contains("_SME") || assetPath.Contains("_A")) | |
AssetDatabaseExperimental.SetImporterOverride<AstcTextureImporter>(assetPath); | |
else if (AssetDatabaseExperimental.GetImporterOverride(assetPath) != null) | |
AssetDatabaseExperimental.ClearImporterOverride(assetPath); | |
} | |
} | |
[ScriptedImporter(1, new [] { "tga", "png", "jpg" }, AllowCaching = true, AutoSelect = false)] | |
public class AstcTextureImporter : ScriptedImporter | |
{ | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment