UIWidget.OnEnable C# (CSharp) Method

OnEnable() protected method

Mark the widget and the panel as having been changed.
protected OnEnable ( ) : void
return void
    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;
        }
    }