Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [4.0.0-pre.2] - 2021-11-20
### Changes
- Fixed italic horizontal displacement of punctuation. (TMPB-133)
- Updated Input Field to not restore the original text when the X in the HoloLens keyboard is pressed.
- Fixed MissingReferenceException when changing scenes. See case [TMPB-120](https://issuetracker.unity3d.com/issues/missingreferenceexception-thrown-when-changing-scenes) and forum [thread](https://forum.unity.com/threads/tmpro-submeshui-error-when-changing-scenes.1129724/) for more info.
- Fixed Undo operation not correctly undoing some newly created TMP objects. Case #1400391
- Fixed glyphs not being drawn in the various font asset inspector tables although present in the glyph table until unselecting and re-selecting the font asset.
- Fixed incorrect line breaking when using a mixture of Latin and CJK text.
- Fixed potential NullReferenceException when creating font asset with multiple atlas textures. See [forum post](https://forum.unity.com/threads/how-can-i-submit-bugs-or-issues-for-tmp.628687/#post-8186100) for details.
- Fixed potential issue when using the <mark> tag in conjunction with Ellipsis.
- Added new "Get Font Features" option in the Generation Settings of Font Assets to provide control over fetching of font feature data.
- Fix potential duplication of Ligature data when using Dynamic Font Assets.
- Added new "duospace" attribute to the <mspace=value> markup tag where the spacing of the '.', ':' and ',' characters will be half of the value. This was added as an option when displaying numerical values using this markup tag.
- With the addition of support for new OpenType Layout features such as Ligatures, Mark-to-Base and Mark-to-Mark, we have made the following changes:
  - The "Kerning" option in the Extra Settings of the text component inspector has been replaced by a new popup menu to independently control these features which are "kern", "liga", "mark" and "mkmk"
  - The "enableKerning" property has been deprecated and replaced by the "fontFeatures" property which is a list that contains which features are enabled on the text component.
- Fixed two potential NullReferenceException related to missing material references or materials on SubMesh text objects. See [forum post](https://forum.unity.com/threads/tmpro-submeshui-error-when-changing-scenes.1129724/#post-8462771) for details.
- Fixed for text alignment mode Justified and Flush blending not working correctly when using <NBSP> in the text.
- Fixed external keyboard on iOS/tvOS and Android when Hide Soft Keyboard is used
- - Fixed a potential IndexOutOfRangeException when trying to select any portions of text in an Input Field whose child text component is using Overflow mode Truncate or Ellipsis where due to RectTransform width and / or height restrictions have results in the text being fully truncated. Case #1361032
- Fixed incorrect character sequencing in the Input Field when using Japanese IME in UWP builds. Case #1374755
- Fixed several potential IndexOutOfRangeException in the Input Field when text is fully truncated when using Text Overflow mode Ellipsis or Truncate.
- Fixed Input Field incorrect caretPosition and / or stringPosition properties when updating these via scripting. Case #1334622
- Fixed incorrect event handling on UWP and Hololens 2. Case #1357718 and Case #1351006
- Fixed Input Field OnSelect event potentially firing twice on some mobile devices including Microsoft Surfaces.
- Fixed Input Field incorrect caret insertion position when text contains a Carriage Return <CR> at the end of a line. Case #1362068
- Added support for <CR> markup tag.
- Added value range check for the text component margins located in the text component extra settings. Case #1365554
- Added new overload to the TMP_FontAsset.CreateFontAsset() to enable creating font asset instances using a file path.
- Added new TMP_ResourceManager.RemoveFontAsset() function to remove a font asset from the TMP Resource Manager. This new function would typically be used prior to unloading bundles and / or resources.
- Warnings about potentially missing character 0x5F used to display underline or strikethrough will only be displayed when using those features when Display Warning is enabled in the TMP Settings.
- Fixed incorrect handling of '-' at the end of a line when using Text Overflow Page mode. Case #1382173
- Fixed incorrect line breaking when a hyphen '-' is preceded by a space. Case #1391990
- When using Text Wrapping Mode - Preserve White Space or Preserve White Space No Wrap, the <ZWSP> character will now contribute to the preferred height when it is the first and only character on a new line.
- Added ClearFontAssetGlyphCache() function to the TMP_ResourcesManager to enable clearing the font asset fallback glyph cache.
- Added new <ZWJ> markup tag.
- Added ability to define a list of fallback text assets in the TMP Settings to be used for Emojis.
- Added new property "emojiFallbackSupport" to text components which is also exposed in the extra settings section of the text component inspector. When enabled, this will prioritize searching the Emoji Fallback Text Assets before the primary font asset for characters defined as Emoji in Unicode 14.0. See [forum post](https://forum.unity.com/threads/fallback-to-emojis-before-fonts.1186174/) for details.
- Fixed duplicated character when using custom validator in conjunction with soft keyboard. Case #1387772
- The <noparse> markup tag will now also affect inline markup tags like <br>, <shy>, etc.
- Fixed newly created StyleSheets having two Normal styles.
- Added new Double Pass SDF shader and example scene to the TMP Examples & Extras to showcase this new shader.
- Added new context menu option to manually "clear dynamic data" of a dynamic font asset. This performs the same clearing of data as the "Clear Dynamic Data on Build" option when manually triggered.
- Added new <a href="url"> markup tag which can be used as follows: "See <a href="http://url...">this link</a> for details.". This new markup tag is similar to the <link> tag but does not use an ID.
- Added new "A" style to the Default Style Sheet referenced in the TMP Settings. This "A" style defines the styling of the new <a> markup tag.
- The TMP_Text.parseCtrlCharacters property which controls the interpretation and parsing of escape characters in the text component's Text Input box in the inspector, will now apply to all methods of setting the text on the component. Case #1400008
- Fixed potential Null Reference Exception when editing the name of a sprite character. Case #1396591
- Fixed issue where TMP_FontAsset.HasCharacters would return false when called prior to font asset initialization. Case #1394817
- Minor TMP_InputField UI improvement where "Hide Mobile Input" property will be disabled when "Hide Soft Keyboard" property is disabled. Case #1388243
  • Loading branch information
Unity Technologies committed Nov 20, 2021
1 parent cec8e71 commit 75fef8b
Show file tree
Hide file tree
Showing 72 changed files with 2,829 additions and 1,709 deletions.
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,56 @@
# Changelog
These are the release notes for the TextMesh Pro UPM package which was first introduced with Unity 2018.1. Please see the following link for the Release Notes for prior versions of TextMesh Pro. http://digitalnativestudios.com/forum/index.php?topic=1363.0

## [4.0.0-pre.2] - 2021-11-20
### Changes
- Fixed italic horizontal displacement of punctuation. (TMPB-133)
- Updated Input Field to not restore the original text when the X in the HoloLens keyboard is pressed.
- Fixed MissingReferenceException when changing scenes. See case [TMPB-120](https://issuetracker.unity3d.com/issues/missingreferenceexception-thrown-when-changing-scenes) and forum [thread](https://forum.unity.com/threads/tmpro-submeshui-error-when-changing-scenes.1129724/) for more info.
- Fixed Undo operation not correctly undoing some newly created TMP objects. Case #1400391
- Fixed glyphs not being drawn in the various font asset inspector tables although present in the glyph table until unselecting and re-selecting the font asset.
- Fixed incorrect line breaking when using a mixture of Latin and CJK text.
- Fixed potential NullReferenceException when creating font asset with multiple atlas textures. See [forum post](https://forum.unity.com/threads/how-can-i-submit-bugs-or-issues-for-tmp.628687/#post-8186100) for details.
- Fixed potential issue when using the <mark> tag in conjunction with Ellipsis.
- Added new "Get Font Features" option in the Generation Settings of Font Assets to provide control over fetching of font feature data.
- Fix potential duplication of Ligature data when using Dynamic Font Assets.
- Added new "duospace" attribute to the <mspace=value> markup tag where the spacing of the '.', ':' and ',' characters will be half of the value. This was added as an option when displaying numerical values using this markup tag.
- With the addition of support for new OpenType Layout features such as Ligatures, Mark-to-Base and Mark-to-Mark, we have made the following changes:
- The "Kerning" option in the Extra Settings of the text component inspector has been replaced by a new popup menu to independently control these features which are "kern", "liga", "mark" and "mkmk"
- The "enableKerning" property has been deprecated and replaced by the "fontFeatures" property which is a list that contains which features are enabled on the text component.
- Fixed two potential NullReferenceException related to missing material references or materials on SubMesh text objects. See [forum post](https://forum.unity.com/threads/tmpro-submeshui-error-when-changing-scenes.1129724/#post-8462771) for details.
- Fixed for text alignment mode Justified and Flush blending not working correctly when using <NBSP> in the text.
- Fixed external keyboard on iOS/tvOS and Android when Hide Soft Keyboard is used
- - Fixed a potential IndexOutOfRangeException when trying to select any portions of text in an Input Field whose child text component is using Overflow mode Truncate or Ellipsis where due to RectTransform width and / or height restrictions have results in the text being fully truncated. Case #1361032
- Fixed incorrect character sequencing in the Input Field when using Japanese IME in UWP builds. Case #1374755
- Fixed several potential IndexOutOfRangeException in the Input Field when text is fully truncated when using Text Overflow mode Ellipsis or Truncate.
- Fixed Input Field incorrect caretPosition and / or stringPosition properties when updating these via scripting. Case #1334622
- Fixed incorrect event handling on UWP and Hololens 2. Case #1357718 and Case #1351006
- Fixed Input Field OnSelect event potentially firing twice on some mobile devices including Microsoft Surfaces.
- Fixed Input Field incorrect caret insertion position when text contains a Carriage Return <CR> at the end of a line. Case #1362068
- Added support for <CR> markup tag.
- Added value range check for the text component margins located in the text component extra settings. Case #1365554
- Added new overload to the TMP_FontAsset.CreateFontAsset() to enable creating font asset instances using a file path.
- Added new TMP_ResourceManager.RemoveFontAsset() function to remove a font asset from the TMP Resource Manager. This new function would typically be used prior to unloading bundles and / or resources.
- Warnings about potentially missing character 0x5F used to display underline or strikethrough will only be displayed when using those features when Display Warning is enabled in the TMP Settings.
- Fixed incorrect handling of '-' at the end of a line when using Text Overflow Page mode. Case #1382173
- Fixed incorrect line breaking when a hyphen '-' is preceded by a space. Case #1391990
- When using Text Wrapping Mode - Preserve White Space or Preserve White Space No Wrap, the <ZWSP> character will now contribute to the preferred height when it is the first and only character on a new line.
- Added ClearFontAssetGlyphCache() function to the TMP_ResourcesManager to enable clearing the font asset fallback glyph cache.
- Added new <ZWJ> markup tag.
- Added ability to define a list of fallback text assets in the TMP Settings to be used for Emojis.
- Added new property "emojiFallbackSupport" to text components which is also exposed in the extra settings section of the text component inspector. When enabled, this will prioritize searching the Emoji Fallback Text Assets before the primary font asset for characters defined as Emoji in Unicode 14.0. See [forum post](https://forum.unity.com/threads/fallback-to-emojis-before-fonts.1186174/) for details.
- Fixed duplicated character when using custom validator in conjunction with soft keyboard. Case #1387772
- The <noparse> markup tag will now also affect inline markup tags like <br>, <shy>, etc.
- Fixed newly created StyleSheets having two Normal styles.
- Added new Double Pass SDF shader and example scene to the TMP Examples & Extras to showcase this new shader.
- Added new context menu option to manually "clear dynamic data" of a dynamic font asset. This performs the same clearing of data as the "Clear Dynamic Data on Build" option when manually triggered.
- Added new <a href="url"> markup tag which can be used as follows: "See <a href="http://url...">this link</a> for details.". This new markup tag is similar to the <link> tag but does not use an ID.
- Added new "A" style to the Default Style Sheet referenced in the TMP Settings. This "A" style defines the styling of the new <a> markup tag.
- The TMP_Text.parseCtrlCharacters property which controls the interpretation and parsing of escape characters in the text component's Text Input box in the inspector, will now apply to all methods of setting the text on the component. Case #1400008
- Fixed potential Null Reference Exception when editing the name of a sprite character. Case #1396591
- Fixed issue where TMP_FontAsset.HasCharacters would return false when called prior to font asset initialization. Case #1394817
- Minor TMP_InputField UI improvement where "Hide Mobile Input" property will be disabled when "Hide Soft Keyboard" property is disabled. Case #1388243

## [4.0.0-pre.1] - 2021-10-27
### Changes
- Fixed incorrect character spacing when using the <scale> tag. See [forum post](https://forum.unity.com/threads/inconsistent-spacing-between-characters-when-scaling-width.1156967/) for details.
Expand All @@ -19,6 +69,7 @@ These are the release notes for the TextMesh Pro UPM package which was first int
- Fixed incorrect parsing of invalid UTF16 and UTF32 character sequences. Case #1367695
- Added new example to the TMP Examples & Extras to showcase new HDRP shaders and inspector.
- Added support for GameCore platform support in the TMP Input Field.
- Added new Ligature Table to Font Assets allowing users to manually define Ligatures. This is a first pass at adding support for Ligatures.

## [3.2.0-pre.1] - 2021-08-06
## [2.2.0-preview.1] - 2021-08-06
Expand Down
56 changes: 56 additions & 0 deletions Documentation~/ColorEmojis.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Color emojis

You can include color glyphs and emojis in text. To do so, import a font file that has color emojis in it and set it as the fallback emojis text assets.

![](images/NativeEmojiExample.png)

## Set up color emojis

Create a color font asset and add it to the TMP Settings Fallback. Note this is the same as the Project Settings/TextMeshPro/Settings as depicted in the image.

1. In your project, import a font file that has color emojis in it.
2. Right click in the `Asset` folder, and then select **Create > TextMeshPro > FontAsset > Color**. This ensures that you create the font asset with the right shader (Sprite) and the right atlas rendering mode (Color).
3. Open the TMP Settings asset or alternatively via the **Edit > ProjectSettings > TextMesh Pro > Settings**.
4. Add the emoji font asset to the **Fallback Emoji Text Assets** section.

![](images/FallbackEmoji.png)

Alternatively, assigning a color font asset to the text object will work fine provided that the [Emoji Fallback Support](ColorEmojis) option in the Extra Settings of the text component is disabled.

## Include emojis in text

To include emojis in text, do the following:

- Include emojis in text through their Unicode. For example, enter `\U00001f60` to represent a smile.
- Use OS Virtual Keyboard.
- Copy the emojis from an external Text Editing tool and paste them in your text field.

To find more information about the Unicode Emojis Standard, see this [link](http://unicode.org/Public/emoji/14.0/).

## Control Emoji Fallback Search

The "Emoji Fallback Support" option controls where we search for characters defined in the Unicode Standards as Emojis.

When this option is enabled (default), the "Fallback Emoji Text Assets" list will be search first for any characters defined as Emojis.

When this option is disabled, the Primary font asset assigned to the text component will be searched first.

Basically, this option overrides the character search to prioritize searching thru the "Fallback Emoji Text Assets" list first when the character is an emoji.

This option is also useful when a font contains black-and-white emojis as it allows the user to control if the emojis contained in the primary will be used or those from the "Fallback Emoji Text Assets" list.

To update the `Emoji Fallback Support`:
1. Select the **Text (TMP)** field in the hierarchy.
2. In the Inspector window, under the `Extra Settings` foldout of the **Text (TMP)** field, select the **Emoji Fallback Support** toggle.

![](images/EmojiFallbackSupport.png)

## Limitations

The color emojis feature has the following limitations:

- It doesn't support some OpenType font features, such as chain context and single substitution.
- It doesn't support Apple fonts that use the AAT format. It's a predecessor to OpenType.
- It doesn't support SVG color glyphs.
- Dynamic OS FontAsset has limited support on some iOS devices. The `Apple Color Emoji` font file found on OSX and several iOS devices works fine. However, the `Apple Color Emoji-160px` found on newer iOS devices is not support as the emoji's are encoded in JPEG format which is not supported by FreeType.
- Prior to Unity 2023.1, adding a UTF-32 through the inspector sends an error. The emojis won't display in the inspector.
43 changes: 43 additions & 0 deletions Documentation~/FontAssets.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,46 @@ Font Assets can have the following types of font atlas:
* **Smooth/Hinted Smooth:** This type of atlas is an antialiased bitmap texture. A Hinted smooth atlas aligns glyph pixels with texture pixels to produce a smoother result.<br/><br/>Smooth atlases work well for static text that is viewed head on, in situations where there is a good correspondence between texture pixels and screen pixels. Transforming text generated from a smooth atlas blurs the text edges.

* **Raster/Raster Hinted:** Raster atlases are un-smoothed bitmap textures. They almost always produce text with jagged, pixellated edges. The Hinted rater atlases align glyph pixels with texture pixels to produce a smoother result.

## Get Font Features

This option determines if OpenType font features should be retrieved from the source font file as new characters and glyphs are added to the font asset. Disabling this option will prevent extracting font features.

To update the Get Font Features option on a FontAsset:
1. Select the FontAsset
2. In the FontAsset inspector, navigate to the Generation Settings section.
3. Select **Get Font Features**.

![](images/GetFontFeatures.png)

## Reset
The `Reset` context menu option clears all tables which includes the Character and Glyph tables along with all font features tables such as the Ligature, Glyph Adjustment, Mark to Base, Mark to Mark tables. This option also clears the font asset's atlas texture and resets it back to size zero.

To reset a FontAsset:
1. Select the FontAsset
2. Expand the top right menu in the FontAsset Inspector.
3. Select **Reset**.

![](images/ResetMenuItem.png)

## Clear Dynamic Data
The `Clear Dynamic Data` context menu option clears the character and glyph tables as well as the font asset's atlas texture which is also resized back to size zero. This option preserves all font feature table data such as Ligatures, Glyph Adjustment, Mark to Base, Mark to Mark, etc.

To clear a FontAsset:
1. Select the FontAsset
2. Expand the top right menu in the FontAsset Inspector.
3. Select **Clear Dynamic Data**.

![](images/ClearDynamicDataMenuItem.png)

This preserves the custom ligatures, kernings, and diacritical marks you added to the font asset when clearing the atlas.

## Clear Dynamic Data on Build
The "Clear Dynamic Data on Build" performs the same function as the "Clear Dynamic Data" context menu option but performs this operation when creating a build as well as when closing the Editor.

To update the Clear Dynamic Data on Build option:
1. Select the FontAsset
2. In the FontAsset inspector, navigate to the Generation Settings section.
3. Select **Clear Dynamic Data on Build**.

![](images/ClearDynamicDataOnBuild.png)
17 changes: 17 additions & 0 deletions Documentation~/TMPObjects.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,20 @@ TextMesh Pro 3D text objects are nearly identical to their UI counterparts, but
1. From the menu, choose **GameObject > 3D GameObject > TextMesh Pro - Text**.
1. In the **TextMesh Pro** Inspector, enter your text.
1. Adjust the [3D text properties](TMPObject3DText.md) as needed.

## OpenType FontFeature
Font Features define the typographic capabilities of a font asset. These features define potential substitutions or positional adjustments of glyphs. The following are the currently supported Font Features:

- **Ligatures:** Defines the substitution of multiple glyphs by a single glyph, such as 'fi' or 'ffl'. This features is identified as "liga".

- **Kerning:** Defines positional adjustments between two glyphs relative to each other. This features is identified as "kern".

- **Diacritical Marks:** Defines positional adjustments between Base glyphs and Mark glyphs.

The Mark-to-Base feature "mark" defines the positional adjustments of Mark glyphs relative to Base glyphs.

The Mark-to-Mark feature "mkmk" defines the positional adjustments of Mark glyphs relative to Base Mark glyphs.

You can enable or disable the Font Features through the Font Features field in the Text component's Extra Settings section shown in the image below:

![](images/FontFeatures.png)
1 change: 1 addition & 0 deletions Documentation~/TableOfContents.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* [Signed Distance Fields](FontAssetsSDF)
* [Dynamic Fonts](FontAssetsDynamicFonts)
* [The Fallback Chain](FontAssetsFallback)
* [Color emojis](ColorEmojis)
* [Rich Text Tags](RichText)
* [Supported Tags](RichTextSupportedTags)
* [<align>](RichTextAlignment)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/ClearDynamicDataOnBuild.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/EmojiFallbackSupport.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/FallbackEmoji.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/FontFeatures.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/GetFontFeatures.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/NativeEmojiExample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documentation~/images/ResetMenuItem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions Editor Resources/GUID CONVERT.json.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TextMesh Pro copyright © 2021 Unity Technologies ApS
TextMesh Pro copyright © 2022 Unity Technologies ApS

Licensed under the Unity Companion License for Unity-dependent projects--see [Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License).

Expand Down
Binary file modified Package Resources/TMP Essential Resources.unitypackage
Binary file not shown.
Binary file modified Package Resources/TMP Examples & Extras.unitypackage
Binary file not shown.
9 changes: 5 additions & 4 deletions Scripts/Editor/HDRP/TMP_BaseHDRPLitShaderGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using UnityEngine;
using UnityEditor;
using UnityEditor.Rendering.HighDefinition;
using UnityEngine.TextCore.Text;


namespace TMPro.EditorUtilities
Expand Down Expand Up @@ -144,7 +145,7 @@ void PrepareGUI()
{
// There's been at least one undo/redo since the last time this GUI got constructed.
// Maybe the undo/redo was for this material? Assume that is was.
TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material as Material);
TextEventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material as Material);
}

s_LastSeenUndoRedoCount = s_UndoRedoCount;
Expand All @@ -166,7 +167,7 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro
DoGUI();
if (EditorGUI.EndChangeCheck())
{
TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material);
TextEventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material);
}

DoDragAndDropEnd();
Expand Down Expand Up @@ -646,7 +647,7 @@ void PerformDrop(Material droppedMaterial)
}

Texture currentTex = m_Material.GetTexture(ShaderUtilities.ID_MainTex);
TMP_FontAsset requiredFontAsset = null;
FontAsset requiredFontAsset = null;
if (droppedTex != currentTex)
{
requiredFontAsset = TMP_EditorUtility.FindMatchingFontAsset(droppedMaterial);
Expand All @@ -668,7 +669,7 @@ void PerformDrop(Material droppedMaterial)
}
}

TMPro_EventManager.ON_DRAG_AND_DROP_MATERIAL_CHANGED(o, m_Material, droppedMaterial);
TextEventManager.ON_DRAG_AND_DROP_MATERIAL_CHANGED(o, m_Material, droppedMaterial);
EditorUtility.SetDirty(o);
}
}
Expand Down
9 changes: 5 additions & 4 deletions Scripts/Editor/HDRP/TMP_BaseHDRPUnlitShaderGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using UnityEngine;
using UnityEditor;
using UnityEditor.Rendering.HighDefinition;
using UnityEngine.TextCore.Text;


namespace TMPro.EditorUtilities
Expand Down Expand Up @@ -148,7 +149,7 @@ void PrepareGUI()
{
// There's been at least one undo/redo since the last time this GUI got constructed.
// Maybe the undo/redo was for this material? Assume that is was.
TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material as Material);
TextEventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material as Material);
}

s_LastSeenUndoRedoCount = s_UndoRedoCount;
Expand All @@ -170,7 +171,7 @@ protected override void OnMaterialGUI(MaterialEditor materialEditor, MaterialPro
DoGUI();
if (EditorGUI.EndChangeCheck())
{
TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material);
TextEventManager.ON_MATERIAL_PROPERTY_CHANGED(true, m_Material);
}

DoDragAndDropEnd();
Expand Down Expand Up @@ -650,7 +651,7 @@ void PerformDrop(Material droppedMaterial)
}

Texture currentTex = m_Material.GetTexture(ShaderUtilities.ID_MainTex);
TMP_FontAsset requiredFontAsset = null;
FontAsset requiredFontAsset = null;
if (droppedTex != currentTex)
{
requiredFontAsset = TMP_EditorUtility.FindMatchingFontAsset(droppedMaterial);
Expand All @@ -672,7 +673,7 @@ void PerformDrop(Material droppedMaterial)
}
}

TMPro_EventManager.ON_DRAG_AND_DROP_MATERIAL_CHANGED(o, m_Material, droppedMaterial);
TextEventManager.ON_DRAG_AND_DROP_MATERIAL_CHANGED(o, m_Material, droppedMaterial);
EditorUtility.SetDirty(o);
}
}
Expand Down
Loading

0 comments on commit 75fef8b

Please sign in to comment.