Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Scene visibility setting in hierarchy not respected by submesh

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

  1. joonturbo

    joonturbo

    Joined:
    Jun 24, 2013
    Posts:
    74
    Sorry for the double post. It doesn't look like I can delete this?
    I've reposted it with the correct tag here: https://forum.unity.com/threads/bug...erarchy-not-respected-by-submesh-fix.1280030/


    Using TextMeshPro 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
    upload_2022-5-4_15-22-58.png
    - save scene
    - start playing
    - stop playing
    - observe: Submesh now has visibility back on
    upload_2022-5-4_15-23-38.png


    NB: the exact same issue happens with the selection prevent icon
    upload_2022-5-4_15-24-4.png
     
    Last edited: May 11, 2022
  2. joonturbo

    joonturbo

    Joined:
    Jun 24, 2013
    Posts:
    74
    There's an easy fix actually, but if I do it myself, the packagemanager just throws out the change when it reloads.
    There's no way to make a pull request, is there?

    Code (CSharp):
    1. #if UNITY_EDITOR
    2.             var visibilityManager = UnityEditor.SceneVisibilityManager.instance;
    3.             if(visibilityManager.IsHidden(go.transform.parent.gameObject))
    4.             {
    5.                 visibilityManager.Hide(go,true);
    6.             }
    7.             if(visibilityManager.IsPickingDisabled(go.transform.parent.gameObject))
    8.             {
    9.                 visibilityManager.DisablePicking(go, true);
    10.             }
    11. #endif
    12.