SpriteText.OnEnable C# (CSharp) Method

OnEnable() public method

public OnEnable ( ) : void
return void
	void OnEnable()
	{
		if (parentControl == null)
			return;

		if (parentControl is AutoSpriteControlBase)
		{
			AutoSpriteControlBase c = (AutoSpriteControlBase)parentControl;
			Hide(c.IsHidden());
		}
// Below is commented out because apparently Unity, when doing a recursive
// activation, activates leaf nodes first, then walks up the
// hierarchy, meaning that the SpriteText would be enabled before
// its parent object, meaning the below test would always result
// in the SpriteText being deactivated, even though its parent
// is in the process of being activated.
//		else
//			gameObject.active = ((Component)parentControl).gameObject.active;
	}