what does @CustomEditor do ?

hi,

I’m trying to build a CustomInspector. But i’m a little bit confused about the example script on unity script reference.

My questions are :

What does @CustomEditor do?
Are there some tutorials for unitycustom examples ( can’t find them)?
What i have to do ,to modify my inspector?

I build some EditorWindow scripts ( these work) , but i want to have an inspector modification.
Maybe you can help me.
Thanks for Answers.

To make a custom inspector, extend “Editor”, and put the @CustomEditor attribute before the class declaration. The attribute tells Unity which class (e.g. which of your MonoBehaviours) that this Editor will work on.

It looks like there’s an error in the doc link you sent. In the @CustomEditor attribute it should be the class you want to edit, not the class that you are defining below.

i.e. instead of:

@CustomEditor(MyPlayerEditor)
class MyPlayerEditor extends Editor {

it should be:

@CustomEditor(MyPlayer)
class MyPlayerEditor extends Editor {