Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

TextMesh Pro Change current material index

Discussion in 'UGUI & TextMesh Pro' started by CoolJosh3k, Feb 14, 2023.

  1. CoolJosh3k

    CoolJosh3k

    Joined:
    Dec 3, 2016
    Posts:
    145
    I have a list of materials that I can choose for the font in an objects inspector, but I need to change which one it uses programmatically.

    However, TMP_Text.m_currentMaterialIndex is inaccessible due to its protection level. I don't immediately see anyway to set this with a method or to replace with a modified instance clone.
     
  2. flashframe

    flashframe

    Joined:
    Feb 10, 2015
    Posts:
    811
    CoolJosh3k likes this.
  3. CoolJosh3k

    CoolJosh3k

    Joined:
    Dec 3, 2016
    Posts:
    145
    flashframe likes this.