Exemplo n.º 1
0
        protected override void OnCanvasHierarchyChanged()
        {
            // Use m_Cavas so we dont auto call CacheCanvas
            Canvas currentCanvas = m_Canvas;

            CacheCanvas();

            if (currentCanvas != m_Canvas)
            {
                GraphicRegistry.UnregisterGraphicForCanvas(currentCanvas, this);
                GraphicRegistry.RegisterGraphicForCanvas(canvas, this);
            }
        }
Exemplo n.º 2
0
        protected override void OnTransformParentChanged()
        {
            base.OnTransformParentChanged();

            if (!IsActive())
            {
                return;
            }

            CacheCanvas();
            GraphicRegistry.RegisterGraphicForCanvas(canvas, this);
            SetAllDirty();
        }
Exemplo n.º 3
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
            if (s_WhiteTexture == null)
            {
                s_WhiteTexture = Texture2D.whiteTexture;
            }

            SetAllDirty();
        }