Beispiel #1
0
 private void EnsureLayoutHasRebuilt()
 {
     if (!m_HasRebuiltLayout && !CanvasUpdateRegistry.IsRebuildingLayout())
     {
         Canvas.ForceUpdateCanvases();
     }
 }
Beispiel #2
0
        public void FontTextureChanged()
        {
            // Only invoke if we are not destroyed.
            if (!this)
            {
                FontUpdateTracker.UntrackText(this);
                return;
            }

            if (m_DisableFontTextureChangedCallback)
            {
                return;
            }

            cachedTextGenerator.Invalidate();

            if (!IsActive())
            {
                return;
            }

            // this is a bit hacky, but it is currently the
            // cleanest solution....
            // if we detect the font texture has changed and are in a rebuild loop
            // we just regenerate the verts for the new UV's
            if (CanvasUpdateRegistry.IsRebuildingGraphics() || CanvasUpdateRegistry.IsRebuildingLayout())
            {
                UpdateGeometry();
            }
            else
            {
                SetAllDirty();
            }
        }
Beispiel #3
0
 /// <summary>
 ///
 /// <para>
 /// Called by the [FontUpdateTracker] when the texture associated with a font is modified.
 /// </para>
 ///
 /// </summary>
 public void FontTextureChanged()
 {
     if (!(bool)((UnityEngine.Object) this))
     {
         FontUpdateTracker.UntrackText(this);
     }
     else
     {
         if (this.m_DisableFontTextureRebuiltCallback)
         {
             return;
         }
         this.cachedTextGenerator.Invalidate();
         if (!this.IsActive())
         {
             return;
         }
         if (CanvasUpdateRegistry.IsRebuildingGraphics() || CanvasUpdateRegistry.IsRebuildingLayout())
         {
             this.UpdateGeometry();
         }
         else
         {
             this.SetAllDirty();
         }
     }
 }
        protected override void OnRectTransformDimensionsChange()
        {
            if (gameObject.activeInHierarchy)
            {
                switch (m_MarqueeDirection)
                {
                case MarqueeDirection.Up:
                case MarqueeDirection.Down:
                    mDownLimitValue = this.rectTransform.rect.min.y - mMoveOffsetValue;
                    mUpLimeitValue  = this.rectTransform.rect.max.y + mMoveOffsetValue;
                    mTextZoneHeight = Mathf.Abs(mUpLimeitValue - mDownLimitValue);
                    break;

                case MarqueeDirection.Right:
                case MarqueeDirection.Left:
                    mLeftLimitValue  = this.rectTransform.rect.min.x - mMoveOffsetValue;
                    mRightLimitValue = this.rectTransform.rect.max.x + mMoveOffsetValue;
                    mTextZoneWidth   = Mathf.Abs(mLeftLimitValue - mRightLimitValue);
                    break;
                }

                // prevent double dirtying...
                if (CanvasUpdateRegistry.IsRebuildingLayout())
                {
                    SetVerticesDirty();
                }
                else
                {
                    SetVerticesDirty();
                    SetLayoutDirty();
                }
            }
        }
Beispiel #5
0
 public void FontTextureChanged()
 {
     if (!this)
     {
         FontUpdateTracker.UntrackText(this);
     }
     else
     {
         if (m_DisableFontTextureRebuiltCallback)
         {
             return;
         }
         cachedTextGenerator.Invalidate();
         if (IsActive())
         {
             if (CanvasUpdateRegistry.IsRebuildingGraphics() || CanvasUpdateRegistry.IsRebuildingLayout())
             {
                 UpdateGeometry();
             }
             else
             {
                 SetAllDirty();
             }
         }
     }
 }
Beispiel #6
0
 private void EnsureLayoutHasRebuilt()
 {
     if (this.m_HasRebuiltLayout || CanvasUpdateRegistry.IsRebuildingLayout())
     {
         return;
     }
     Canvas.ForceUpdateCanvases();
 }
Beispiel #7
0
 protected override void OnRectTransformDimensionsChange()
 {
     if (base.gameObject.activeInHierarchy)
     {
         if (CanvasUpdateRegistry.IsRebuildingLayout())
         {
             SetVerticesDirty();
             return;
         }
         SetVerticesDirty();
         SetLayoutDirty();
     }
 }
Beispiel #8
0
 protected void SetDirty()
 {
     if (IsActive())
     {
         if (!CanvasUpdateRegistry.IsRebuildingLayout())
         {
             LayoutRebuilder.MarkLayoutForRebuild(rectTransform);
         }
         else
         {
             StartCoroutine(DelayedSetDirty(rectTransform));
         }
     }
 }
 protected override void OnRectTransformDimensionsChange()
 {
     if (gameObject.activeInHierarchy)
     {
         // prevent double dirtying...
         if (CanvasUpdateRegistry.IsRebuildingLayout())
         {
             SetVerticesDirty();
         }
         else
         {
             SetVerticesDirty();
             SetLayoutDirty();
         }
     }
 }
Beispiel #10
0
 /// <summary>
 /// <para>Called by the [FontUpdateTracker] when the texture associated with a font is modified.</para>
 /// </summary>
 public void FontTextureChanged()
 {
     if ((this != null) && !this.m_DisableFontTextureRebuiltCallback)
     {
         this.cachedTextGenerator.Invalidate();
         if (this.IsActive())
         {
             if (CanvasUpdateRegistry.IsRebuildingGraphics() || CanvasUpdateRegistry.IsRebuildingLayout())
             {
                 this.UpdateGeometry();
             }
             else
             {
                 this.SetAllDirty();
             }
         }
     }
 }