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. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

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?