Website powered by

Material Tracker: A Unity Editor Tool Adventure - 1

Making Of / 26 October 2023

Once upon a chilly morning, as I navigated through the labyrinth of my Unity project, a thought sparked in my mind. My scenes were bustling with materials and shaders, each contributing to the aesthetic appeal of the game. However, tracking them had become akin to finding a needle in a haystack. It was then that I envisioned a tool, a trusty companion in my editor that could list all materials, the game objects they adorned, and the shaders they employed. LOL, what a story.

With a goal etched in my mind, I embarked on a quest to create a Unity editor tool. Below is the fruit borne of my endeavor:

I'm honored to share this with you guys: 

.cs file on Google Drive

You can also get it free at the Artstation shop: Material Lister for Unity

The inception was simple; a button to list all materials used in the open scene. However, as the list grew, it was a mere text dump, bland to look at. I decided it needed a touch of elegance. Introducing sections and boxes added a structured layout, making it visually more appealing and organized.

The first draft of my tool was functional but primitive. It could list materials but finding them in the project or inspecting them was a manual chore. "Why not add a 'Find' and a 'Select' button next to each material?" I thought. And so, with a few lines of code, I made it possible to find a material in the Project window or select it for a closer inspection in the Inspector.

However, the plot thickened when I realized that materials with identical names but residing in different folders could wreak havoc. It was crucial to use the path to distinguish between these materials. Instead of adding that feature for now, I tested it with well-named materials and added a note as "Works with proper naming and no duplicated materials in the project." which is clean enough for now.

 As I beheld the tool, I realized it could do more. A small addition allowed me to view statistics at the top, like the total count of materials, shaders, and renderers in the scene. It was not just a lister anymore; it was a dashboard providing a glimpse into the material landscape of my scene.

With each iteration, the tool became more than just a lister. It was a reflection of my growing understanding of Unity's editor scripting. It's fascinating how a small spark of thought can lead to a tool that stands as a sentinel, overseeing the materials in my Unity scenes. And as I gazed upon the neatly listed materials, a sense of satisfaction enveloped me. The tool was a modest yet significant step towards a more organized and efficient workflow. And who knows? The morrow might bring forth new ideas to further refine this humble companion of mine.

Further Development Ideas

For the next version of the tool, I have an idea for now to sell them in the shop by increasing price with the each valuable feature. Let's see how it evolves.