Example #1
0
        /// <summary>
        /// Clear references.
        /// </summary>
        protected override void OnDisable()
        {
#if UNITY_EDITOR
            GraphicRebuildTracker.UnTrackGraphic(this);
#endif
            GraphicRegistry.DisableGraphicForCanvas(canvas, this);
            CanvasUpdateRegistry.DisableCanvasElementForRebuild(this);

            if (canvasRenderer != null)
            {
                canvasRenderer.Clear();
            }

            LayoutRebuilder.MarkLayoutForRebuild(rectTransform);

            base.OnDisable();
        }
Example #2
0
 protected override void OnBeforeTransformParentChanged()
 {
     GraphicRegistry.DisableGraphicForCanvas(canvas, this);
     LayoutRebuilder.MarkLayoutForRebuild(rectTransform);
 }