[Unity] Custom Editor for Unity
[Overview]
- Decompile UnityEditor.dll by ILSpy
- Find default editor class name:GameObjectInspector
- DecoratorEditor
- Example: Apply button for new nested prefab system
[Decompile UnityEditor.dll by ILSpy]
Download ILSpy for Mac
https://github.com/icsharpcode/ILSpy
Find your UnityEditor.dll
Decompile UnityEditor.dll
mono ILSpyMac.exe -n Decompiled ../UnityEditor_2018_4
[Find default editor class name]
Search all decompiled files by the target component. Ex: GameObject
CustomEditor(typeof(GameObject))
Then you’ll find the default editor name for GameObject is GameObjectInspector
[DecoratorEditor]
Then you’ll need this class to start customizing your editor.
DecoratorEditor.cs
https://gist.github.com/liortal53/352fda2d01d339306e03Created by Lior Tal
http://www.li0rtal.com/extending-unity-inspectors/
The main concept use Decorator Pattern.
The decorator implements all public inspector methods, delegating them to the decorated instance internally.
[Example: Apply button for new nested prefab system]
GameObjectEditor “decorates” GameObjectInspector by inherited from DecoratorEditor