This page looks best with JavaScript enabled

Automatically Processing Assets with Custom Unity Asset Pipelines

 ·   ·  ☕ 1 min read

Continuing our journey of adding the ability to easily use SVG assets in Unity, today we’re going to be exploring how to automatically process and convert SVGs to PNGs whenever one is added to our Unity project.

In order to handle Unity asset import events we need to create an AssetPostprocessor by creating a custom class that inherits from the class. Once that’s done we can extend our custom Asset Processing using the provided methods from Unity. A list of those is available here:

The AssetPostprocessor’s OnPostprocessAllAssets function is called when the Assets imported into your project have changed. In this case, if we move, delete or add new assets this is the message that will be invoked for us to hook into those changes and run our custom Asset processing.

For more information you can check out the documentation here:

The code I’m using expects Inkscape to be on your PATH. If you don’t have Inkscape installed you can download it here: If Inkscape is correctly configured you should be able to run inkscape --help in your terminal and get a valid response.

Join the World of Zero Discord Server:

Sam Wronski
Sam Wronski
Maker of things and professional software engineer. Lets make something awesome together!