Why use !IsActive instead of !enabled

In the Debugging Tools module of the Realm Rush tutorial, Gary used the following to toggle the enabled state of the label:

label.enabled = !label.IsActive();

I was wondering why IsActive() is used rather then the following:

label.enabled = !label.enabled;

Hi,

That’s a good question. He probably used the IsActive() method out of habit. In many cases, there are multiple ways to make something work in Unity. Feel free to use yours. :slight_smile:


See also:

4 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms