Search Unity

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?