Search Unity

Editor for Inspector when nothing selected

Discussion in 'Scripting' started by ayellowpaper, Apr 3, 2020.

  1. ayellowpaper

    ayellowpaper

    Joined:
    Dec 8, 2013
    Posts:
    52
    Hey,

    as the title says I want to display an Editor for when nothing is selected.
    This might not make sense at first glance, but I basically want to draw custom fields, buttons and information related to the scene to the user and want to avoid creating a custom window. It just clutters the Screen and the Inpsector is just empty anyway.
    I'm strongly assuming this isn't possible, but I got my hopes up :D

    EmptyInspector.png

    Thanks in advance,

    yellowpaper
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    I'm pretty sure this isn't possible.
     
  3. Ardenian

    Ardenian

    Joined:
    Dec 7, 2016
    Posts:
    313
    You could write your own EditorWindow to create a custom inspector for your scenes (even if you don't want to do that). You could then check in Selection if there is currently an object selected in the editor. I don't know if it is possible to change editor tabs programmatically, though.

    You might be able to fake your desired behavior by writing a custom editor window which displays Editor.DrawDefaultInspector of your selected object and draws other stuff if your selection is empty. Not sure if this is actually possible, just an idea how it could work.