Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh Pro Bug Scene visibility setting in hierarchy not respected by submesh + fix

Discussion in 'UGUI & TextMesh Pro' started by joonturbo, May 11, 2022.

  1. joonturbo

    joonturbo

    Joined:
    Jun 24, 2013
    Posts:
    77
    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.

    Code (CSharp):
    1.  
    2. go.transform.SetParent(textComponent.transform, false);
    3. go.transform.SetAsFirstSibling();
    4. go.layer = textComponent.gameObject.layer;
    5.  
    6. #if UNITY_EDITOR
    7. var visibilityManager = UnityEditor.SceneVisibilityManager.instance;
    8. if(visibilityManager.IsHidden(go.transform.parent.gameObject))
    9. {
    10.     visibilityManager.Hide(go,true);
    11. }
    12. if(visibilityManager.IsPickingDisabled(go.transform.parent.gameObject))
    13. {
    14.     visibilityManager.DisablePicking(go, true);
    15. }
    16. #endif
    17.            
     
    wasam likes this.
  2. joonturbo

    joonturbo

    Joined:
    Jun 24, 2013
    Posts:
    77
    this still happens, in case I wasn't clear:
    the solution currently requires you bypass the package manager, would be nice to have it included in an official patch.