Search Unity

How can I extend TextMesh Pro Inspector?

Discussion in 'UGUI & TextMesh Pro' started by stefanob, May 30, 2019.

  1. stefanob

    stefanob

    Joined:
    Nov 26, 2012
    Posts:
    68
    Hello,

    I would like to use a custom inspector for TextMeshProUGui Objects which contains an extra string variable.
    Here is what I did so far:

    Code (CSharp):
    1.  
    2. [CustomEditor(typeof(TextMeshProUGUI), true), CanEditMultipleObjects]
    3.     public class CustomTMPEditorPanel : TMP_UiEditorPanel
    4.     {
    5.         public override void OnInspectorGUI()
    6.         {
    7.            
    8.         }
    9.  
    10.     }
    This doesn't change the Inspector. Shouldn't this already hide all the properties because I override OnInspectorGUI?
    Or is it because TMPro is not a default component?

    Thanks!
     
    travlake likes this.
  2. travlake

    travlake

    Joined:
    Oct 4, 2019
    Posts:
    50
    Resurrecting this thread because I have the same question. Can work around this by adding another custom component but am curious why what @stefanob did doesn't work