Skip to content

Instantly share code, notes, and snippets.

@renaudbedard
Created May 30, 2020 19:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renaudbedard/babef2fc87fb474519ad42b7df54b190 to your computer and use it in GitHub Desktop.
Save renaudbedard/babef2fc87fb474519ad42b7df54b190 to your computer and use it in GitHub Desktop.
Import Remapping
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