- Home /
Custom icons for custom Monobehaviours in custom namespaces
Hi!
As answered here correctly, you can add custom icons for your Monobehaviours by putting an appropriately named icon in the "Assets/Gizmos" folder of your project. This works fine, until I try to do that for classes that belong to a custom namespace. I tried naming the icon "namespace.classname icon", but that didn't work. Does anybody here have an idea? Not using namespaces is out of the question, because I really don't want to have prefixes in my classnames, or have the classnames "float around" the users classes.
Thanks!
Answer by swalex · Feb 20, 2016 at 06:50 PM
Looks like you can place the icon in a subfolder structure matching your namespaces (at least with Unity 4.7). For example place the icon for
namespace FancySoft.Common {
public class MagicScript : MonoBehaviour {
}
}
in Assets\Gizmos\FancySoft\Common
and name it (as usual) MagicScript icon.png
.
Your answer
![](https://koobas.hobune.stream/wayback/20220611234411im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unable to set a custom Gizmo icon "other" is missing 1 Answer
Is there a better way to have custom Script icons than Assets/Gizmos 0 Answers
MonoScript, Type or namespace UnityEditor couldn't be found 0 Answers
Gizmos DrawIcon NOT located in Gizmos folder 0 Answers
Custom asset icons changed after upgrade to Unity 2017.2 0 Answers