Exemple #1
0
        /// <summary>
        /// Mark the Graphic and the canvas as having been changed.
        /// </summary>
        protected override void OnEnable()
        {
            base.OnEnable();
            CacheCanvas();
            GraphicRegistry.RegisterGraphicForCanvas(canvas, this);

#if UNITY_EDITOR
            GraphicRebuildTracker.TrackGraphic(this);
#endif
            SetAllDirty();
        }
Exemple #2
0
 protected override void OnEnable()
 {
     base.OnEnable();
     this.CacheCanvas();
     GraphicRegistry.RegisterGraphicForCanvas(this.canvas, this);
     GraphicRebuildTracker.TrackGraphic(this);
     if (s_WhiteTexture == null)
     {
         s_WhiteTexture = Texture2D.whiteTexture;
     }
     this.SetAllDirty();
 }
Exemple #3
0
 protected override void OnDisable()
 {
     GraphicRebuildTracker.UnTrackGraphic(this);
     GraphicRegistry.UnregisterGraphicForCanvas(this.canvas, this);
     CanvasUpdateRegistry.UnRegisterCanvasElementForRebuild(this);
     if (this.canvasRenderer != null)
     {
         this.canvasRenderer.Clear();
     }
     LayoutRebuilder.MarkLayoutForRebuild(this.rectTransform);
     base.OnDisable();
 }
Exemple #4
0
        protected override void OnDestroy()
        {
#if UNITY_EDITOR
            GraphicRebuildTracker.UnTrackGraphic(this);
#endif
            GraphicRegistry.UnregisterGraphicForCanvas(canvas, this);
            CanvasUpdateRegistry.UnRegisterCanvasElementForRebuild(this);
            if (m_CachedMesh)
            {
                Destroy(m_CachedMesh);
            }
            m_CachedMesh = null;

            base.OnDestroy();
        }
        /// <summary>
        /// Mark the Graphic and the canvas as having been changed.
        /// </summary>
        protected override void OnEnable()
        {
            base.OnEnable();
            CacheCanvas();
            GraphicRegistry.RegisterGraphicForCanvas(canvas, this);

#if UNITY_EDITOR
            GraphicRebuildTracker.TrackGraphic(this);
#endif
            if (s_WhiteTexture == null)
            {
                s_WhiteTexture = Texture2D.whiteTexture;
            }

            SetAllDirty();
        }
Exemple #6
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);
            SendGraphicEnabledDisabled();
            base.OnDisable();
        }