Fun tidbits from the docs on MonoBehaviour:

"This class doesn't support the null-conditional operator (?.) and the null-coalescing operator (??)."

There is a cryptic note that "There is a checkbox for enabling or disabling MonoBehaviour in the Unity Editor. It disables functions when unticked. If none of these functions are present in the script, the Unity Editor does not display the checkbox. The functions are:

Start()
Update()
FixedUpdate()
LateUpdate()
OnGUI()
OnDisable()
OnEnable()"

It does not say where this checkbox is, nor why you would want to do this.

@peterdrake Those types of things are typically not really mentioned in the Unity scripting reference docs, you will need to rely on a mix of videos, Unity forum posts, and random social media posts.

If you were curious, that checkbox is at the top of inspector entry for each script. Here's an image of a script with and without one.

Follow

@andykorth Oh, THAT checkbox!

I always thought of that as "pretend this component isn't here" rather than "don't call these specific methods", but I guess it amounts to the same thing.

· · 0 · 0 · 0
Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.