Customise script assets icon and/or their tint color in the Unity Editor.
Script Icon Customiser provides a small Unity Editor utility window that allows you to:-
- Change the icon displayed for script (C#) asset files in the Unity Project window.
- Revert back to default Unity script icon.
You can customise & apply a new icon to one or multiple selected scripts by either:-
- choosing a custom icon texture from you project assets and/or apply a tint color to further customise it,
- or simply changing the color (tint) of the default Unity script icon.
- Clean UI built with UIElements (VisualElement + USS).
- The icon is reflected in the Unity Inspector and everywhere in Unity Editor.
- Move your custom Texture2D icon asset within the project safely without script icons reverting to default.
- Quick restore to Unity default icon.
- Exists only in the Editor, nothing's packaged into the build.
Note
Recommended Unity Editor version 6000.3+, albeit supports 2021.3+.
Some UI alignments might be iffy in Editor versions below 6000.3 but does the job it's meant to.
This makes it easier to update the package from the Package Manager directly.
-
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
-
Click
AddorInstall -
Unity will download and install the package automatically.
-
Open your Unity project.
-
Navigate to:
Path/Of/Your/UnityProject/Packages/manifest.json
- Add the package under dependencies:
{
"dependencies": {
"com.basement-experiments.script-icon-customiser": "https://github.com/gamesbyBAE/script-icon-customiser.git"
}
}- Save the file and return to Unity.
Unity will automatically resolve and install the package.
- Clone the repository to your local machine:
git clone https://github.com/gamesbyBAE/script-icon-customiser.git-
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 disk…orInstall package from disk... -
Browse and navigate to the cloned repository.
-
Select and open the
package.jsonfile. -
The package will now be added as a local package.
Note: Local packages are linked to the folder on disk. Any changes made to the package files will immediately reflect in Unity. Hence, good for modding the package and testing.
-
Select one or more script assets in the Project window.
-
Open the Editor Window:
- Menu:
Assets ➜ Script Icon ➜ Change Icon - Shortcut:
Cmd/Ctrl + Alt + Shift + C(%&#c) - Right Click Menu:
Right Click ➜ Script Icon ➜ Change Icon
- Menu:
-
Use the
Image Pickerto choose a custom texture (or chooseNoneto use Unity’s default MonoScript icon). -
Use the
Color Pickerto choose a tint color (optional). -
Previewshows the, you-guessed-it, the preview (result). Adjust color or texture as needed. -
You can drag & drop more scripts to be modified in the
Target Scriptsarea. -
Click
Applyto set the icon for selected MonoScript assets.
-
Select one or more script assets in the Project window.
-
There are two ways to restore:-
-
Quick Restore:
- Menu:
Assets ➜ Script Icon ➜ Restore Icon - Shortcut:
Cmd/Ctrl + Alt + Shift + R(%&#r) - Right Click Menu:
Right Click ➜ Script Icon ➜ Restore Icon
- Menu:
-
From Editor Window:
- Follow any of the below option to open the window:
- Menu:
Assets ➜ Script Icon ➜ Change Icon - Shortcut:
Cmd/Ctrl + Alt + Shift + C(%&#c) - Right Click Menu:
Right Click ➜ Script Icon ➜ Change Icon
- Menu:
- You can drag & drop more scripts to be modified in the
Target Scriptsarea. - Click
Restoreto set the default Unity MonoScript asset icon.
- Follow any of the below option to open the window:
-
-
ScriptIconCustomiser.uss - Unity Style Sheet (USS) for customising the window's appearance.
-
ScriptIconChangerWindow.cs - EditorWindow and menu hooks.
-
WindowPresenter.cs - Creates views, builds layout, coordinates events & views.
-
CoreService.cs - High-level orchestrator for core features.
- IconGenerator.cs - Fetches the default Unity icon, generates only the tinted icons (copies and tints) else passes the stock user Texture2D.
- IconSaver.cs - Saves generated icons under
Assets/BasementExperiments/CustomScriptIconsfolder. - IconApplier.cs - Applies icon using
MonoImporter.
-
The utility modifies the icon set via
MonoImporter.SetIconfollowed bySaveAndReimport(), which may trigger a reimport for the asset(s). This is normal. -
Icon textures that are tinted and not in their stock form are saved to the directory,
Assets/BasementExperiments/CustomScriptIcons.- Necessary to save in the project because Unity uses the GUID to map the icon to the project asset.
- For the case, package is installed from local disk, it's possible to directly save the icons in the package directory itself without bloating your actual Unity project directory.
Contributions welcome via PRs - fixes, performance improvements, or feature additions.
- Open a new Unity project.
- Create a new directory in the project's Assets directory,
Assets ➜ <your-directory-name> - Clone the repository into this newly created directory.
- Explore the code under
Editor/Scriptsfor logic andEditor/Stylesheetsto modify styles.
All the scripts must live inside theEditordirectory. - Run the window from the menu,
Assets ➜ Script Icon ➜ Change Icon.
MIT, see LICENSE in this folder.
Mayank 'DerperDoing' Bagchi
www.mayankbagchi.dev