Power Inspector | Complete Inspector Rewrite

What Is Power Inspector?

Power Inspector is not just another Custom Editor inside the default inspector, but instead it completely flips the script; it is a totally new window that replicates all the features of the original inspector - and then adds a lot more on top of that.

If I’ve done my job right, Power Inspector should feel comfortably familiar to pick up, even though under the hood everything has changed.

This has been a massive project that’s been years in the making with more than
100 000 lines of code.

Why Go Through All This Trouble?

The goal with this project has been to gain access to the minute details of the inspector’s functionality, so that it becomes possible to start eliminating pain points and improving workflow at a much deeper level than previously possible.

For example, the way that you move control focus with the keyboard arrows in the default inspector has always bugged me. But with the default inspector it was basically impossible to do anything about this, because I could not get detailed information about all the elements inside the inspector view. With Power Inspector this is no longer an issue, configuring every aspect of the inspector experience was now a possibility, and I could implement perfect keyboard support.

And once the foundations had been laid, I could really start going crazy and keep implementing feature after feature on top of this new framework.

Asset Store - Buy Power Inspector
Webpage - Find the blog, contact information…
Online Documentation - Full details on features
Issue Tracker - Report and track bugs
Join Mailing List - Be in the know

Features

Search Box


All the other main views in Unity have a search box, so I though why not the inspector too?
There are currently seven different filtering modes that can be used. You can run, data, but you can’t hide!
read more

Split View


The inspector can be split into two parts in order to display the data of two targets simultaneously side by side. The middle mouse button can be used as a shortcut to open a mouseovered target in the split view (I call this “peeking”).
read more

Back and Forward Buttons


Back and forward buttons have been integrated into a toolbar above the inspector.
read more

Copy-Paste


I added copy-paste support to almost everything in the inspector. I use the system clipboard to hold the copied data, which has turned out to be a surprisingly convenient thing, making it easy to do things like backup any data from the inspector view into a text editor.
Pro tip: One of my favorite use cases for this is copying import settings from existing textures into ones that were just added to the project.
read more

Debug Mode+


I replicated the debug mode in the default inspector and extended it by adding support for viewing non-serialized members, fields with the HideInInspector attribute, hidden components, properties, methods and static class members.
Also I noticed that what I often wanted was to activate debug mode only temporarily and only for a single component, which is why I decided to add a new debug mode toggle button into the toolbar above every component.
read more

Quick Invoke Menu


I ran into this scenario often: I wanted to invoke a method in a class for testing purposes. To do this, I open the script in my script editor, add the ContextMenu attribute above the method, wait for scripts to recompile, and then I’m able to invoke the method from the context menu. If I was in play mode at the time, I have to restart my play session. Once I’m done testing, I have to repeat many of the same steps to remove the ContextMenu attribute too.
To streamline this process I added a button into the header of all Components and other UnityEngine.Objects that can be used to invoke methods at any time.
read more

Create Script Wizard


Creating new scripts and attaching them to targets is arguably fastest to do using the Add Component menu in the default inspector.
However all scripts are added to the root of your project, and inside the default namespace. In some projects I’ve worked on this has lead to the project root being full of unorganized scripts, and let me tell you it is not a fun situation to be in.
To combat this problem I hooked a script creation wizard into the Add Component button in Power Inspector. The idea is to combine fast script creation with the ability to quickly define where the scripts are saved and in which namespace. This saves you the trouble of having to move the scripts around later on, and then having to wait for scripts to recompile.
read more

Keyboard Friendly


Like I mentioned before, I rewrote the field focusing system inside the inspector from scratch so that everything works intuitively as it should.
I also added keyboard support to everywhere where I found it was missing. I feel that small things like being able to use page up, page down, home and end inside popup menus can do a lot for making it fun to use the keyboard for navigating inside the inspector.
I also introduced shortcuts for some common actions like copy (Ctrl+C), paste (Ctrl+V) and reset (backspace).
read more

Improved Tooltips


Tooltips can be a really useful tool for offering additional information about controls.
But how does the user know which controls have them and which not? I added a tooltip indicator so that users will always know when there’s additional information available for a field.

Also it found it irritating that I had to add the same information once using comments in code to get tooltips in my IDE, and then a second time using Unity’s Tooltip attribute to get tooltips in the inspector. To solve this issue I made it so that Power Inspector automatically generates tooltips from the comments in your code for all fields, properties and methods.
read more

Improved Script Editor


I found it really difficult to preview code of script assets inside the default inspector, because it had no syntax highlighting, and the combination of really wide tab character and word wrapping made it hard to keep discern which row you were on.
I made a new script editor that fixes everything that bugged me about the default script inspector.
read more

Target Window


To improve the working experience when using ultra-wide monitors or a multi-monitor setup, I made it possible to have different inspector windows for the hierarchy and project views.
read more

Plug and Play

Making Power Inspector work in plug-and-play fashion, and to keep it as decoupled from code as possible, was important to me.
I’ve had experiences in the past where some extension I was using started to get buggy with new Unity versions, but I was unable to easily remove it from my project because of the number of references I had to it in my code.
To help reduce this risk I tried to make as many features usable without needing to do any changes in code.
read more

More Information

You can find more in-depth explanations about all the features of Power Inspector in the Online Documentation.

5 Likes

To celebrate the launch, you can now snatch Power Inspector for yourself for 40% below its normal asking price! :hushed:

I wrote an article detailing my process for building the launch trailer for Power Inspector in Unity. Check it out if you're interested:
https://www.sisus.co/how-to-build-a-trailer-using-unity/

Since I've had the same question asked a couple of times now, I'll put an answer out here too:
Yes, Power Inspector and Odin Inspector can be used together at the same time.

I wrote a documentation page detailing how to set them up optimally so that you get the best of both worlds:
Compatibility With Odin Inspector

1 Like

Version 1.0.2 is now available from the asset store.

My compliments for the docs, looks very neat and complete! Really incredible what seems to be possible with Power Inspector, I think I’ll just download it and see if it meets my expectations…

Cheers!

Thanks @Fronne ! I hope you'll find the the software just as neat as the documentation :)

@SisusCo
Hi, this asset looks good!

Unfortunately v1.2.0 has 2 compile errors on 2019.3b6.
FieldDrawer.cs: CanBeNull => CanBeNullAttribute
UnityObjectDrawer.cs: add protected const float ComponentHeaderToolbarIconHeight = 16f;

I've fixed by myself, but I'm not sure about sufficient test on 2019.3.
How about it?

Also, I'd like to know the increment of compile time with power inspector since this is large code base.
How do you think about it?

Thank you for your help.

Oh, not working on material on 2019.3b6...
I will look forward to it for now.

Hi @pocketpair

Thanks for letting me know about these issues.

I noticed the same compile errors in 2019.3 beta and pushed a fix out for it yesterday, and version 1.2.1 just went live containing the fixes.

The material drawer indeed seems to be broken in 2019.3 beta. I’ll add support for it in the next update.

Power Inspector comes preconfigured with assembly definition files, so in theory it should not affect your compile times at all when you make changes to your scripts, as long as you don’t have references in your code to Power Inspector.

When I change code inside the main Power Inspector assembly it takes around 4 seconds to fully recompile everything on my computer.

@pocketpair

I just pushed out a new update that fixes the material drawer and improves support overall for the 2019.3 beta version of Unity.

The update will be available for download as soon as it passes the asset store’s approval process. This usually takes around a day, but I’m not sure if any updates are being approved before next Monday.

Have a nice weekend!

could it be possible at all to have like color coded script areas? like.. the entire area of a script is like slightly blue and another is green ?

i mean as an extra idea

Hi @LuiBroDood . Thank you for the suggestion!

I did a quick test to see how easy it would be to pull this off. Turns out you can get pretty decent results right out of the gate:

The dynamic prefix column resize control currently looks pretty bad on top of the custom color, though. A quick workaround for this would be to switch the drawer to use the top-only resize control that is usually used by all custom editors:

However, I'll see if I can improve how the resize control is drawn, so that it works better with backgrounds of all different colors, so there's no longer need for such a workaround.

This is how the Draw method of my test ColoredComponentDrawer ended up looking:

        /// <inheritdoc />
        public override bool Draw(Rect position)
        {
            // Draw the background color
            DrawGUI.Active.ColorRect(position, color);

            // Also temporarily set all background colors in theme to match this color.
            var theme = inspector.Preferences.theme;
            GUIThemeColors.BackgroundColors previousBackgroundColors;
            var transparentColor = new Color(0f, 0f, 0f, 0f);
            theme.SetBackgroundColors(transparentColor, out previousBackgroundColors);

            bool dirty;
            try
            {
                dirty = base.Draw(position);
            }
            catch(Exception)
            {
                theme.RestoreBackgroundColors(previousBackgroundColors);
                throw;
            }

            theme.RestoreBackgroundColors(previousBackgroundColors);
            return dirty;
        }

Now that's much better...

Power Inspector was just updated to version 1.2.5. You can learn more about what new features were added here.

If you would like to be kept informed about major new Power Inspector releases, you can also subscribe to our newsletter here.

Very impressed by this, will most likely buy it soon :)

Good to hear that it works fine with Odin.

@N00MKRAD Thank you, I hope you will enjoy it a lot!

Yes indeed. It has become very clear that having great Odin support is pretty much mandatory, based on the number of people asking about it at least :smile: Not that its surprising, it does offer some pretty awesome features, and it makes sense that there would be a lot of overlap in people interested in both products :slight_smile:

HYYPE!! INSTABUY
soo how would i use ColoredComponentDrawer exactly?
thanks!

GOOD STUFF!

oh i found it

    /// [UseDrawer(typeof(ColoredComponentDrawer), 0.246f, 0.55f, 1f, 1f)]

    /// public class TestColoredDrawer : MonoBehaviour { }



[Sisus.Attributes.UseDrawer(typeof(Sisus.ColoredComponentDrawer), R, G, B, A)]

would be cool to have this built into it maybe ?
it works, but if i use the ColoredComponentDrawer , this stops working
https://discussions.unity.com/t/671671

@ LuiBroDood

Ah yes, I did not think to add support for combining custom editors with the colored background!

I'll add a variant of ColoredComponentDrawer that utilizes a custom editor. I'll also add a new attribute purpose-built for changing the background color, so that the right drawer can be selected automatically. Something like BackgroundColorAttribute(r, g, b, a).

Does this solution sound like something that would serve you well?

I also do like the idea of being able to draw the class members of ScriptableObject references directly inside a single inspector view, and have been planning to introduce support for doing something like that in Power Inspector at some point in the future.