Search Unity

Feature Request Components with more visible labels in Inspector

Discussion in 'Editor & General Support' started by danielesuppo, Sep 25, 2022.

  1. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    331
    Please, could it be possible with some of the next Unity releases to have more visible lables for each component attached to a GameObject (maybe in blue/red, whatever color you like) ?
    It would be very helpful when a component (script) has a lot of variables, and actually when you scroll up/down you can't figure quickly where some component start/end
    Many thanks
     
    Last edited: Sep 25, 2022
  2. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    1,329
    It looks component titles in the inspector window support rich text tags, so it is possible to change their color and font size by modifying the titles in the internal dictionary that the inspector uses.

    Code (CSharp):
    1. <size=14><color=#64c9ff>Transform</color></size>
    2. <size=14><color="yellow">Light</color></size>
    3. <size=14><color=#b1fd59>Box Collider</color></size>
    component-names-rich-text.png

    I tested if it's possible to use rich text tags with the AddComponentMenu attribute.

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. [AddComponentMenu("Test/<size=14><color=#64c9ff>Colored Name</color></size>")]
    4. public class ColoredName : MonoBehaviour { }
    But alas, it's not...

    add-component-menu-attribute.png


    Still, with the help of some reflection, it looks like something like this is doable.
     
    AnimalMan likes this.