public virtual void MarkAsChanged ()
{
if (NGUITools.GetActive(this))
{
mChanged = true;
#if UNITY_EDITOR
if(this != null)<--ADD THIS CHECK HERE
{
NGUITools.SetDirty(this);
}
#endif
// If we're in the editor, update the panel right away so its geometry gets updated.
if (panel != null && enabled && NGUITools.GetActive(gameObject) && !mPlayMode)
{
SetDirty();
CheckLayer();
#if UNITY_EDITOR
// Mark the panel as dirty so it gets updated
if (material != null) NGUITools.SetDirty(panel.gameObject);
#endif
}
}
}