I have a default StyleSheet and a new StyleSheet with one style in it named “Test”. The new StyleSheet is selected in TMP Settings.asset.
No matter what I do, <style=“Test”>Text does not work. It just displays “<style=“Test”>Text”. If I attempt to use a style from the default StyleShset it works fine.
If I change the default font in the TMP Settings just to test if it’s being applied, it works fine.
Are you changing the style sheet referenced in the TMP Settings at runtime via code or are you changing / assigning it in the Editor where it doesn’t appear to take / use the new style sheet?
I’m using it via Editor Inspector.
https://i.imgur.com/6qs9f9G.png
I’ll try taking a look later today / tonight.
It’s been ignored for a few days. Could you at least tell me if you have looked at them? I paid for this product and now the premium support is gone because your forum now suggests to come here for support.
I am not ignoring the posts just been crazy busy and unable to get to this.
I’ll take a look later this afternoon and provide feedback thereafter.
Update
I have been able to reproduce the behavior and implement a solution for it.
The following new function needs to be added to the TMP_StyleSheet.cs just before the RefreshStyles() function around line 95.
/// <summary>
/// Function to update the internal reference to a newly assigned style sheet in the TMP Settings.
/// </summary>
public static void UpdateStyleSheet()
{
// Reset instance
s_Instance = null;
RefreshStyles();
}
Then in the TMP_SettingsEditor.cs, make the following changes around line 223.
GUILayout.Space(5f);
EditorGUI.BeginChangeCheck(); // Add this new line.
EditorGUILayout.PropertyField(prop_StyleSheet);
// Add these new lines as well.
if (EditorGUI.EndChangeCheck())
{
serializedObject.ApplyModifiedProperties();
TMP_StyleSheet.UpdateStyleSheet();
}
EditorGUILayout.EndVertical(); // existing line of code.
This change should make it where changing the style sheet in the TMP Settings will automatically update on text objects.
If you are changing style from scripting after having modified to properties of the TMP Settings to allow you to do this, call this new TMP_StyleSheet.UpdateStyleSheet(); after you make you new assignment.
These changes will be included in the next release of the TMP UPM package (not in version 1.3.0) which mostly includes UI refactoring. So the one after that 