How to change C# script asset icon in Unity?
NOT a tutorial but is in a way…
Hello there, fellow internet dweller on quest for answers!
Would you like to customise the C# script asset icons of your Unity project for free because:
- you want to reduce cognitive load for programmers & enable designers and non-programmers to navigate scripts intuitively through colour-coded & icon-coded systems?
- make critical scripts pop visually?
- may be simply prefer visually appealing things in your Unity Editor?
- or, you have your own reasons (we don’t judge here)!
Meet — Script Icon Customiser
I’ve created an open-source Unity package to help you achieve that.
(No, that em dash is not by ChatGPT 🙂)
Unity Package Repo
https://github.com/gamesbyBAE/script-icon-customiser.git
This Unity Editor tool adds a small editor window plus a couple of menu items to your Unity project. With it, you can:
- Change the icon of one or more C# script assets.
- Use either a tinted version of Unity’s default script icon or a custom texture from your project (optionally, customise it’s color as well).
- Restore everything back to the default icon in one click if you change your mind.
It’s built to feel like a native part of the editor, not “some random hack” you’re afraid to commit.
Install it the easy way (Unity Package Manager, Git URL)
There are multiple ways to install the package, but if you just want to use it, this is the path of least resistance (also, the easiest to get package updates).
Depending on your Unity version (6000.3+ recommended) the options may differ, but I’ve tried my best here to cover the steps for different versions.
- Open your project in Unity.
- Go to
Window ➜ Package ManagerorWindow ➜ Package Management ➜ Package Manager - Click the
+button in the top-left corner. - Select
Add package from git URL…orInstall package from git URL… - Paste this repository URL:
https://github.com/gamesbyBAE/script-icon-customiser.git - Hit
AddorInstalland let Unity do its thing.
That’s it. Once it finishes, the new menu items will be available under Assets ➜ Script Icon.
How to use this tool?
Here’s the “tutorial” part on using this tool to customise the script icons (very clickbaity?).
Apply Custom Icon:
1. Select one or more script assets in the Project window.
2. Open the Editor Window in any of these ways:
- Menu:
Assets ➜ Script Icon ➜ Change Icon, or - Shortcut:
Cmd/Ctrl + Alt + Shift + C, or - Right Click Menu:
Right Click ➜ Script Icon ➜ Change Icon
3. In the window:
- Use the image picker to select a custom texture, or leave it empty to just tint the default script icon.
- Use the color picker to set a tint if you want.
- Check the preview to see what the final icon will look like.
6. Drag any extra scripts you want to affect into the Target Scripts list.
7. Click Apply button.
Unity will briefly reimport those assets and our Project window and Inspector will now show the new icon for those scripts.
Restore Default Icon:
If you or a teammate go overboard with colors or assigned a wrong icon, you can reset things quickly.
Option 1: Quick Restore
- Select the scripts you want to reset.
- Use any one of the methods:
- Menu:
Assets → Script Icon → Restore Icon, or - The provided restore shortcut, or
- The same right‑click menu under
Script Icon → Restore Icon.
Option 2: From the Editor Window
- Open the Custom Script Icon editor window again (
Assets → Script Icon → Change Iconor shortcut). - Make sure the target list contains the scripts you want to reset.
- Click
Restorebutton.
Unity will reimport and bring back the classic script icon.
How it works under the hood?
Well if you are here not just to use the tool, but to learn how to build something like this yourself (you were expecting that kinda tutorial…),
at this point, I’ve no intentions of creating a tutorial or in-depth explanation but you’re free to explore the repo, it may not be the best but it’s surely not spaghetti.
I’ve tried my best to keep the repo and scripts well structured and easy to read.
You’ll find:
- A dedicated editor window script that is the entry point of this tool along with menu hooks.
- A presenter layer coordinating UI and logic.
- Core services that:-
- Grab the default icon.
- Generate tinted copies or pass through your custom textures.
- Save the new icons into a folder Unity can track.
- Apply them to scripts through Unity’s importer API.
If you’re exploring editor tools architecture, this is a nice, self‑contained example that touches UIElements, Unity Style Sheet (USS), editor menus, and asset importers without becoming a huge framework.
Want to Contribute?
If this package saves you time or makes your project feel a bit more “yours”, consider:
- Starring the repo on GitHub.
- Opening an issue if you hit a bug or have a feature idea.
- Sending a pull request if you:
- Improve performance or UX.
- Add useful options.
- Clean up or extend the code.
Here’s the repo again in case you missed it earlier:-
https://github.com/gamesbyBAE/script-icon-customiserUse it in your next project, and turn that wall of identical C# icons into something your future self (and your teammates) will actually enjoy looking at.
🏃🏽♂️Until we meet again!
www.MayankBagchi.dev
