Ejemplo n.º 1
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();
            }
        }
Ejemplo n.º 2
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();
         }
     }
 }
Ejemplo n.º 3
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();
             }
         }
     }
 }
Ejemplo n.º 4
0
 public void ReflashCanvas()
 {
     if (AltSketchPaintHandler.MSecSinceLastRender >= m_RenderUpdateTimer.Interval ||
         !CanvasUpdateRegistry.IsRebuildingGraphics())
     {
         CanvasUpdateRegistry.RegisterCanvasElementForGraphicRebuild(this);
     }
 }
Ejemplo n.º 5
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();
             }
         }
     }
 }