Cocos creator, what you can expose on the inspector?

I was recently working on port a game from Unity to cocos creator.
Right now I was looking at the inspector components of the cocos creator.
I see that we can expose ‘Nodes’, ‘Number’, ‘Vec3’
Usually we can expose variable that inherit from the ‘Component’ type.
Even we can expose data like arrays from ‘SpriteFrame’ but looks like you cannot do that for array of nodes. This can also help for prefabs.

image

I was wonder how you can for example setup events ?

Here on the script of the button it already do that.

image

But I cannot find how to use this, setup event on the inspector can save a lot of setup and scripting.

1 Like

Whiles I don’t know how to do it. You can search the source code for cc.button and see how they do it for the button and you can probably just lift that code and use it in your own scripts.