UntrackText() public static method

public static UntrackText ( Text t ) : void
t Text
return void
示例#1
0
 public override void OnRebuildRequested()
 {
     FontUpdateTracker.UntrackText(this);
     FontUpdateTracker.TrackText(this);
     this.cachedTextGenerator.Invalidate();
     base.OnRebuildRequested();
 }
示例#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();
         }
     }
 }
示例#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();
             }
         }
     }
 }
示例#4
0
        public void FontTextureChanged()
        {
            // Only invoke if we are not destroyed.
            if (!this)
            {
                FontUpdateTracker.UntrackText(this);
                return;
            }

            if (m_DisableFontTextureRebuiltCallback)
            {
                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();
            }
        }
示例#5
0
        public override void OnRebuildRequested()
        {
            // After a Font asset gets re-imported the managed side gets deleted and recreated,
            // that means the delegates are not persisted.
            // so we need to properly enforce a consistent state here.
            FontUpdateTracker.UntrackText(this);
            FontUpdateTracker.TrackText(this);

            // Also the textgenerator is no longer valid.
            cachedTextGenerator.Invalidate();

            base.OnRebuildRequested();
        }
示例#6
0
 protected override void OnValidate()
 {
     if ((UnityEngine.Object) this.m_FontData.font != (UnityEngine.Object) this.m_LastTrackedFont)
     {
         Font font = this.m_FontData.font;
         this.m_FontData.font = this.m_LastTrackedFont;
         FontUpdateTracker.UntrackText(this);
         this.m_FontData.font = font;
         FontUpdateTracker.TrackText(this);
         this.m_LastTrackedFont = font;
     }
     base.OnValidate();
 }
示例#7
0
文件: Text.cs 项目: shicheju1/ugui
        // The Text inspector editor can change the font, and we need a way to track changes so that we get the appropriate rebuild callbacks
        // We can intercept changes in OnValidate, and keep track of the previous font reference
        protected override void OnValidate()
        {
            if (m_FontData.font != m_LastTrackedFont)
            {
                Font newFont = m_FontData.font;
                m_FontData.font = m_LastTrackedFont;
                FontUpdateTracker.UntrackText(this);
                m_FontData.font = newFont;
                FontUpdateTracker.TrackText(this);

                m_LastTrackedFont = newFont;
            }
            base.OnValidate();
        }
示例#8
0
 protected override void OnValidate()
 {
     if (!this.IsActive())
     {
         base.OnValidate();
     }
     else
     {
         if (this.m_FontData.font != this.m_LastTrackedFont)
         {
             Font font = this.m_FontData.font;
             this.m_FontData.font = this.m_LastTrackedFont;
             FontUpdateTracker.UntrackText(this);
             this.m_FontData.font = font;
             FontUpdateTracker.TrackText(this);
             this.m_LastTrackedFont = font;
         }
         base.OnValidate();
     }
 }
示例#9
0
 protected override void OnDisable()
 {
     FontUpdateTracker.UntrackText(this);
     base.OnDisable();
 }