protected virtual void OnEnable()
{
#if UNITY_EDITOR
if (GetComponents<UIWidget>().Length > 1)
{
Debug.LogError("Can't have more than one widget on the same game object!", this);
enabled = false;
}
else
#endif
{
mChanged = true;
if (!keepMaterial)
{
mMat = null;
mTex = null;
}
mPanel = null;
}
}