Search Unity

TextMesh Pro TMP_SubMeshUI m_subTextObjects set sibling index by default

Discussion in 'UGUI & TextMesh Pro' started by dwit_mass_creation, Apr 16, 2020.

  1. dwit_mass_creation

    dwit_mass_creation

    Joined:
    Jun 18, 2015
    Posts:
    74
    Can you change m_subTextObjects sibling index by default to i - 1 after creating it?

    Code (CSharp):
    1. m_subTextObjects[i].rectTransform.SetSiblingIndex(i - 1);
    Right now after adding TMP_SubMeshUI UI hierarchy is wrong by default.

    For example if I have hierarchy with image over text:
    -Text
    --- Image

    After using letters from fallbacks hierarchy is:
    -Text
    --- Image
    --- TMP SubMeshUI

    So then letters from main font are behind image and from fallback after image.
    By default hierarchy should be maintained.

    And right now there is no good (many bad) way to fix it from outside (for example text update is not after text change but later during late update, so I can't fix it when I change text).
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I don't see any real issues in doing this. I will test it tomorrow and following up once I have more information but seems logical.
     
    dwit_mass_creation likes this.