Пример #1
0
        void OnDestroy()
        {
            //Debug.Log("***** OnDestroy() called on Sub Object ID [" + GetInstanceID() + "]. Parent Text Object ID [" + textComponent.GetInstanceID() + "] *****");

            // Destroy Mesh
            if (m_mesh != null)
            {
                DestroyImmediate(m_mesh);
            }

            if (m_fallbackMaterial != null)
            {
                TMP_MaterialManager.ReleaseFallbackMaterial(m_fallbackMaterial);
                m_fallbackMaterial = null;
            }

            #if UNITY_EDITOR
            // Unregister the event this object was listening to
            TMPro_EventManager.MATERIAL_PROPERTY_EVENT.Remove(ON_MATERIAL_PROPERTY_CHANGED);
            TMPro_EventManager.FONT_PROPERTY_EVENT.Remove(ON_FONT_PROPERTY_CHANGED);
            //TMPro_EventManager.TEXTMESHPRO_PROPERTY_EVENT.Remove(ON_TEXTMESHPRO_PROPERTY_CHANGED);
            TMPro_EventManager.DRAG_AND_DROP_MATERIAL_EVENT.Remove(ON_DRAG_AND_DROP_MATERIAL);
            //TMPro_EventManager.TEXT_STYLE_PROPERTY_EVENT.Remove(ON_TEXT_STYLE_CHANGED);
            TMPro_EventManager.SPRITE_ASSET_PROPERTY_EVENT.Remove(ON_SPRITE_ASSET_PROPERTY_CHANGED);
            //TMPro_EventManager.TMP_SETTINGS_PROPERTY_EVENT.Remove(ON_TMP_SETTINGS_CHANGED);
            #endif
            m_isRegisteredForEvents = false;

            // Notify parent text object
            m_TextComponent.havePropertiesChanged = true;
            m_TextComponent.SetAllDirty();
        }
Пример #2
0
        void OnDestroy()
        {
            // Destroy Mesh
            if (m_mesh != null)
            {
                DestroyImmediate(m_mesh);
            }

            if (m_fallbackMaterial != null)
            {
                TMP_MaterialManager.ReleaseFallbackMaterial(m_fallbackMaterial);
                m_fallbackMaterial = null;
            }

#if UNITY_EDITOR
            // Unregister the event this object was listening to
            TMPro_EventManager.MATERIAL_PROPERTY_EVENT.Remove(ON_MATERIAL_PROPERTY_CHANGED);
            TMPro_EventManager.FONT_PROPERTY_EVENT.Remove(ON_FONT_PROPERTY_CHANGED);
            //TMPro_EventManager.TEXTMESHPRO_PROPERTY_EVENT.Remove(ON_TEXTMESHPRO_PROPERTY_CHANGED);
            TMPro_EventManager.DRAG_AND_DROP_MATERIAL_EVENT.Remove(ON_DRAG_AND_DROP_MATERIAL);
            //TMPro_EventManager.TEXT_STYLE_PROPERTY_EVENT.Remove(ON_TEXT_STYLE_CHANGED);
            TMPro_EventManager.SPRITE_ASSET_PROPERTY_EVENT.Remove(ON_SPRITE_ASSET_PROPERTY_CHANGED);
            //TMPro_EventManager.TMP_SETTINGS_PROPERTY_EVENT.Remove(ON_TMP_SETTINGS_CHANGED);
#endif
            m_isRegisteredForEvents = false;
        }
Пример #3
0
        protected override void OnDisable()
        {
            //Debug.Log("*** SubObject OnDisable() ***");
            //base.OnDisable();

            //m_canvasRenderer.Clear();
            //TMP_UpdateRegistry.UnRegisterCanvasElementForRebuild(this);

            if (canvasRenderer != null)
            {
                canvasRenderer.Clear();
            }

            if (m_MaskMaterial != null)
            {
                TMP_MaterialManager.ReleaseStencilMaterial(m_MaskMaterial);
                m_MaskMaterial = null;
            }

            if (m_fallbackMaterial != null)
            {
                TMP_MaterialManager.ReleaseFallbackMaterial(m_fallbackMaterial);
                m_fallbackMaterial = null;
            }
        }
Пример #4
0
 private void OnDisable()
 {
     m_meshFilter.sharedMesh = null;
     if (m_fallbackMaterial != null)
     {
         TMP_MaterialManager.ReleaseFallbackMaterial(m_fallbackMaterial);
         m_fallbackMaterial = null;
     }
 }
Пример #5
0
        void OnDisable()
        {
            // Hide the geometry when the object is disabled.
            m_meshFilter.sharedMesh = null;

            if (m_fallbackMaterial != null)
            {
                TMP_MaterialManager.ReleaseFallbackMaterial(m_fallbackMaterial);
                m_fallbackMaterial = null;
            }
        }
Пример #6
0
        void OnDisable()
        {
            //Debug.Log("***** OnDisable() called on Sub Object ID [" + GetInstanceID() + "]. Parent Text Object ID [" + textComponent.GetInstanceID() + "] *****");

            // Hide the geometry when the object is disabled.
            m_meshFilter.sharedMesh = null;

            if (m_fallbackMaterial != null)
            {
                TMP_MaterialManager.ReleaseFallbackMaterial(m_fallbackMaterial);
                m_fallbackMaterial = null;
            }
        }
Пример #7
0
 private void OnDestroy()
 {
     if (m_mesh != null)
     {
         UnityEngine.Object.DestroyImmediate(m_mesh);
     }
     if (m_fallbackMaterial != null)
     {
         TMP_MaterialManager.ReleaseFallbackMaterial(m_fallbackMaterial);
         m_fallbackMaterial = null;
     }
     m_isRegisteredForEvents = false;
 }
Пример #8
0
 private void OnDestroy()
 {
     if (this.m_mesh != null)
     {
         Object.DestroyImmediate(this.m_mesh);
     }
     if (this.m_fallbackMaterial != null)
     {
         TMP_MaterialManager.ReleaseFallbackMaterial(this.m_fallbackMaterial);
         this.m_fallbackMaterial = null;
     }
     this.m_isRegisteredForEvents = false;
 }
Пример #9
0
 // Event received when font asset properties are changed in Font Inspector
 void ON_FONT_PROPERTY_CHANGED(bool isChanged, TMP_FontAsset font)
 {
     if (m_fontAsset != null && font.GetInstanceID() == m_fontAsset.GetInstanceID())
     {
         // Copy Normal and Bold Weight
         if (m_fallbackMaterial != null)
         {
             if (TMP_Settings.matchMaterialPreset)
             {
                 TMP_MaterialManager.ReleaseFallbackMaterial(m_fallbackMaterial);
                 TMP_MaterialManager.CleanupFallbackMaterials();
             }
         }
     }
 }
Пример #10
0
 protected override void OnDisable()
 {
     TMP_UpdateRegistry.UnRegisterCanvasElementForRebuild(this);
     if (this.m_MaskMaterial != null)
     {
         TMP_MaterialManager.ReleaseStencilMaterial(this.m_MaskMaterial);
         this.m_MaskMaterial = null;
     }
     if (this.m_fallbackMaterial != null)
     {
         TMP_MaterialManager.ReleaseFallbackMaterial(this.m_fallbackMaterial);
         this.m_fallbackMaterial = null;
     }
     base.OnDisable();
 }
Пример #11
0
 protected override void OnDisable()
 {
     TMP_UpdateRegistry.UnRegisterCanvasElementForRebuild((ICanvasElement)(object)this);
     if (base.m_MaskMaterial != null)
     {
         TMP_MaterialManager.ReleaseStencilMaterial(base.m_MaskMaterial);
         base.m_MaskMaterial = null;
     }
     if (m_fallbackMaterial != null)
     {
         TMP_MaterialManager.ReleaseFallbackMaterial(m_fallbackMaterial);
         m_fallbackMaterial = null;
     }
     //((MaskableGraphic)this).OnDisable();
     base.OnDisable();
 }
        protected override void OnDisable()
        {
            //Debug.Log("*** SubObject OnDisable() ***");
            base.OnDisable();

            // if (m_MaskMaterial != null)
            // {
            //     TMP_MaterialManager.ReleaseStencilMaterial(m_MaskMaterial);
            //     m_MaskMaterial = null;
            // }

            if (m_fallbackMaterial != null)
            {
                TMP_MaterialManager.ReleaseFallbackMaterial(m_fallbackMaterial);
                m_fallbackMaterial = null;
            }
        }
Пример #13
0
 private void OnDestroy()
 {
     if (m_mesh != null)
     {
         UnityEngine.Object.DestroyImmediate(m_mesh);
     }
     if (m_fallbackMaterial != null)
     {
         TMP_MaterialManager.ReleaseFallbackMaterial(m_fallbackMaterial);
         m_fallbackMaterial = null;
     }
     TMPro_EventManager.MATERIAL_PROPERTY_EVENT.Remove(ON_MATERIAL_PROPERTY_CHANGED);
     TMPro_EventManager.FONT_PROPERTY_EVENT.Remove(ON_FONT_PROPERTY_CHANGED);
     TMPro_EventManager.DRAG_AND_DROP_MATERIAL_EVENT.Remove(ON_DRAG_AND_DROP_MATERIAL);
     TMPro_EventManager.SPRITE_ASSET_PROPERTY_EVENT.Remove(ON_SPRITE_ASSET_PROPERTY_CHANGED);
     m_isRegisteredForEvents = false;
 }
Пример #14
0
 protected override void OnDestroy()
 {
     if (this.m_mesh != null)
     {
         Object.DestroyImmediate(this.m_mesh);
     }
     if (this.m_MaskMaterial != null)
     {
         TMP_MaterialManager.ReleaseStencilMaterial(this.m_MaskMaterial);
     }
     if (this.m_fallbackMaterial != null)
     {
         TMP_MaterialManager.ReleaseFallbackMaterial(this.m_fallbackMaterial);
         this.m_fallbackMaterial = null;
     }
     this.m_isRegisteredForEvents = false;
     this.RecalculateClipping();
 }
Пример #15
0
 protected override void OnDestroy()
 {
     if (m_mesh != null)
     {
         UnityEngine.Object.DestroyImmediate(m_mesh);
     }
     if (base.m_MaskMaterial != null)
     {
         TMP_MaterialManager.ReleaseStencilMaterial(base.m_MaskMaterial);
     }
     if (m_fallbackMaterial != null)
     {
         TMP_MaterialManager.ReleaseFallbackMaterial(m_fallbackMaterial);
         m_fallbackMaterial = null;
     }
     TMPro_EventManager.MATERIAL_PROPERTY_EVENT.Remove(ON_MATERIAL_PROPERTY_CHANGED);
     TMPro_EventManager.FONT_PROPERTY_EVENT.Remove(ON_FONT_PROPERTY_CHANGED);
     TMPro_EventManager.DRAG_AND_DROP_MATERIAL_EVENT.Remove(ON_DRAG_AND_DROP_MATERIAL);
     TMPro_EventManager.SPRITE_ASSET_PROPERTY_EVENT.Remove(ON_SPRITE_ASSET_PROPERTY_CHANGED);
     m_isRegisteredForEvents = false;
     //((MaskableGraphic)this).RecalculateClipping();
     RecalculateClipping();
 }