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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    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:
    672
    CoolJosh3k likes this.
  3. CoolJosh3k

    CoolJosh3k

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