- Home /
How is the Avatar Mask creation in the Inspector made?
How would I duplicate this? I'm creating a custom inspector and for simplicity's sake I want to be able to drag my armor components onto targets on the player.
Are you talking about the skeleton looking thing in the inspector that's green/red?
It's probably using EditorGUI to render textures for each portion, with different colors. Look at EditorGUI, and there should be some on rendering textures.
The hard part is actually getting this implemented, as I've always been confused with making EditorGUI look right in the inspector, and I've always used EditorGUILayout ins$$anonymous$$d..
Answer by Bunny83 · Aug 21, 2015 at 03:29 AM
Well, the Avatar editor is a quite huge thing. Just see for yourself. Download ILSpy and open the UnityEditor.dll assembly found in your Unity installation folder "\Unity\Editor\Data\Managed\".
The class that is most likely responsible for drawing and handling the Avatar mask is the "AvatarSkeletonDrawer" class. However the whole Avatar editor is made up by 15 classes. It consists of several modules for the different edit modes. The class "AvatarEditor" is the actual custom inspector for the Avatar object. The "AvatarControl" class has a nested "Styles" class which seem to hold quite a few GUIStyle icon references.
I don't think you'll get any more specific answers about that topic ^^. For reference here's my OnGUI crash course.
Your answer
Follow this Question
Related Questions
How to retain reference to a ReorderableList element even when it's reordered? 0 Answers
Edit an object in isolation quickly, as in the new Prefab Mode 0 Answers
Is it possible to detect drag and drop in hierachy window? 0 Answers
Custom Editor - Is there any way to detect whether the user is in Prefab editing mode? 1 Answer
(newbie) How to recreate an Editor Window button in a Game View ? 0 Answers