Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Unity provide "enabling toggle" on script when it goes in Editor folder?

Tags:

c#

editor

unity3d

I have a monobehaviour class that I use in UnityEditor. It looks like this: enter image description here

When I put it into the Editor folder, the inspector changes into this: enter image description here

Why this happening and what does it mean ?

like image 628
Vladislav Hromyh Avatar asked Mar 11 '23 10:03

Vladislav Hromyh


1 Answers

The enabling checkbox for a mono behaviour script means that it contains 'Start' or 'Update' methods. You can prevent unity from calling these methods by disabling the checkbox. If your script does not contain either of these methods then the checkbox disappears.

However for an editor script it is somehow different. Editor classes don't work with 'Start' and 'Update' so the checkbox appears there.

like image 114
Bizhan Avatar answered Apr 08 '23 08:04

Bizhan