I am reposting this, because I didn’t tag TextMeshPro.
I will delete the old post.
Bug observed Using TextMeshPro UI 3.0.6, Unity 2021.3.0f1 LTS
Repro steps
- new scene
- add textmeshpro object
- select a non-default font asset
- set the text input to “<sprite=1>” (so it creates a submesh)
- set scene visibility to false for entire hierarchy
- save scene
- start playing
- stop playing
- observe: Submesh now has visibility back on
NB: the exact same issue happens with the selection prevent icon
===== UPDATE
I have a suggested fix.
To be added to TMP_SubMeshUI.cs, on line 222.
go.transform.SetParent(textComponent.transform, false);
go.transform.SetAsFirstSibling();
go.layer = textComponent.gameObject.layer;
#if UNITY_EDITOR
var visibilityManager = UnityEditor.SceneVisibilityManager.instance;
if(visibilityManager.IsHidden(go.transform.parent.gameObject))
{
visibilityManager.Hide(go,true);
}
if(visibilityManager.IsPickingDisabled(go.transform.parent.gameObject))
{
visibilityManager.DisablePicking(go, true);
}
#endif