# What is the difference between a game object being disabled and it made inactive?

I am looking over a script that has a particular function called to disable the script and mark a list for re-structuring:

void Disable()
{
gameObject.SetActive(false);
isEnumerated = false;
}


What I am trying to determine is whether it would be better to simply have the code in the OnDisable() function:

void OnDisable()
{
isEnumerated = false;
}


I found that OnDisable() calls whenever the game object is "disabled" or "inactive", but I am a bit confused on the exact difference between the two. Documentation I have found that references both is only specific in that they are two different cases, where places that offer definition appear to use the two words synonymously.

• AFAIK OnDisable() is the method used by Unity when disabling an object. Where is the Disable() script being called from? The Disable() method, by calling gameObject.SetActive(false), is causing that gameObject and its MonoBehaviours to be deactivated. – TJClifton Jun 7 '15 at 11:47
• @TJClifton OnDisable() and Disable() are being called from the same script. Disable was the original function. I have re-written it as OnDisable, as Disable() is being called to deliberately disable the script, where I want to change the bool if the object (a GUI Texture) is not on the screen at all. – Gnemlock Jun 8 '15 at 0:42
• Can you link the Documentation you found that specifies they are two different things? As far as I know they are just words used interchangeably to indicate a GameObject that has been "disabled" by either turning it off with SetActive(false), or being the child of an "inactive" or "disabled" parent... You can think of "disabled" as being the act of setting a gameobject to inactive. – Jeremiah Leslie Jun 8 '15 at 10:24