Example #1
0
        public virtual void SetLayoutDirty()
        {
            if (!IsActive())
            {
                return;
            }

            LayoutRebuilder.MarkLayoutForRebuild(rectTransform);

            if (m_OnDirtyLayoutCallback != null)
            {
                m_OnDirtyLayoutCallback();
            }
        }
Example #2
0
        /// <summary>
        /// Clear references.
        /// </summary>
        protected override void OnDisable()
        {
#if UNITY_EDITOR
            GraphicRebuildTracker.UnTrackGraphic(this);
#endif
            GraphicRegistry.UnregisterGraphicForCanvas(canvas, this);
            CanvasUpdateRegistry.UnRegisterCanvasElementForRebuild(this);

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

            LayoutRebuilder.MarkLayoutForRebuild(rectTransform);
            base.OnDisable();
        }
Example #3
0
        protected override void OnDisable()
        {
            CanvasUpdateRegistry.UnRegisterCanvasElementForRebuild(this);

            if (m_HorizontalScrollbar)
            {
                m_HorizontalScrollbar.onValueChanged.RemoveListener(SetHorizontalNormalizedPosition);
            }
            if (m_VerticalScrollbar)
            {
                m_VerticalScrollbar.onValueChanged.RemoveListener(SetVerticalNormalizedPosition);
            }

            m_HasRebuiltLayout = false;
            m_Tracker.Clear();
            m_Velocity = Vector2.zero;
            LayoutRebuilder.MarkLayoutForRebuild(rectTransform);
            base.OnDisable();
        }
Example #4
0
 protected override void OnBeforeTransformParentChanged()
 {
     GraphicRegistry.UnregisterGraphicForCanvas(canvas, this);
     LayoutRebuilder.MarkLayoutForRebuild(rectTransform);
 }
Example #5
0
 protected override void OnDisable()
 {
     m_Tracker.Clear();
     LayoutRebuilder.MarkLayoutForRebuild(rectTransform);
     base.OnDisable();
 }