Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only.

    Please, do not make any changes to your username or email addresses at id.unity.com during this transition time.

    It's still possible to reply to existing private message conversations during the migration, but any new replies you post will be missing after the main migration is complete. We'll do our best to migrate these messages in a follow-up step.

    On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live.


    Read our full announcement for more information and let us know if you have any questions.

Question Easiest way (in an editor window) to make some labels in a tree view red?

Discussion in 'Immediate Mode GUI (IMGUI)' started by burningmime, May 15, 2023.

  1. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    845
    If you have a missing prefab in a scene it's shown with a red label...

    upload_2023-5-15_3-30-12.png

    How would I achieve something similar in a custom TreeView? I tried using rich text by adding
    <color=red>
    to the TreeViewItem.displayName but that clearly didn't work...

    upload_2023-5-15_3-31-54.png

    I'm guessing the real answer lies in overriding the RowGUI() somehow. What is the most straightforward way to do this in as little code as possible?