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.

Power Inspector | Complete Inspector Rewrite

Discussion in 'Assets and Asset Store' started by SisusCo, Aug 28, 2019.

?

What Are Your Favorite Features?

  1. Back and Forward Buttons

  2. Search Box

  3. Split View

  4. Copy-Paste

  5. Debug Mode+

  6. Quick Invoke Menu

  7. Create Script Wizard

  8. Keyboard Friendly

  9. Improved Tooltips

  10. Target Window

Multiple votes are allowed.
Results are only viewable after voting.
  1. nghillaz

    nghillaz

    Joined:
    Sep 4, 2014
    Posts:
    4
    It's the standard "Prefab" header when inspecting an object in your scene that's an instance of a prefab - not a component i don't think. This is what it looks like in the standard inspector:
    upload_2023-2-4_15-1-50.png

    I don't have any custom inspectors installed.

    Worth noting is that even non-prefab objects have a slightly squished header compared to the standard inspector:
    upload_2023-2-4_15-5-47.png

    upload_2023-2-4_15-5-56.png

    It might be the forward-backward buttons row is cutting into the available height and not adjusting everything else accordingly?
     
  2. nghillaz

    nghillaz

    Joined:
    Sep 4, 2014
    Posts:
    4
    May be relevant - i'm now seeing an error in the console that sounds related:
    upload_2023-2-4_15-8-29.png

    Code (CSharp):
    1. System.NullReferenceException: Object reference not set to an instance of an object
    2.   at UnityEditor.RangeDrawer.CreatePropertyGUI (UnityEditor.SerializedProperty property) [0x00021] in <f7044ab663d344a2badf1160e57d1c1d>:0
    3.   at Sisus.PropertyDrawerDrawer.Setup (System.Object setValue, System.Object attribute, UnityEditor.PropertyDrawer setDrawerInstance, System.Type drawerType, Sisus.LinkedMemberInfo setMemberInfo, Sisus.IParentDrawer setParent, UnityEngine.GUIContent setLabel, System.Boolean setReadOnly) [0x00041] in C:\Users\Nathan\Documents\It-Takes-a-Village\Assets\Sisus\Power Inspector\Code\Editor\Drawers\Property\PropertyDrawerDrawer.cs:235
    4.   at Sisus.PropertyDrawerDrawer.SetupInterface (System.Object attribute, System.Object setValue, Sisus.LinkedMemberInfo setMemberInfo, Sisus.IParentDrawer setParent, UnityEngine.GUIContent setLabel, System.Boolean setReadOnly) [0x00061] in C:\Users\Nathan\Documents\It-Takes-a-Village\Assets\Sisus\Power Inspector\Code\Editor\Drawers\Property\PropertyDrawerDrawer.cs:203
    5.   at Sisus.DrawerProviderBase.GetForPropertyDrawer (System.Type drawerType, System.Attribute fieldAttribute, System.Object value, Sisus.LinkedMemberInfo memberInfo, Sisus.IParentDrawer parent, UnityEngine.GUIContent label, System.Boolean readOnly) [0x00009] in C:\Users\Nathan\Documents\It-Takes-a-Village\Assets\Sisus\Power Inspector\Code\Editor\Drawers\Provider\DrawerProviderBase.cs:843
    6.   at Sisus.DrawerProviderBase.GetForField (System.Object value, System.Type fieldType, Sisus.LinkedMemberInfo memberInfo, Sisus.IParentDrawer parent, UnityEngine.GUIContent label, System.Boolean readOnly, System.Boolean ignoreAttributes) [0x000dd] in C:\Users\Nathan\Documents\It-Takes-a-Village\Assets\Sisus\Power Inspector\Code\Editor\Drawers\Provider\DrawerProviderBase.cs:631
    7.   at Sisus.ParentDrawerUtility.BuildMembers (Sisus.IDrawerProvider drawerProvider, Sisus.IParentDrawer parent, System.Collections.Generic.List`1[T] buildList, System.Collections.Generic.List`1[T] results) [0x000a7] in C:\Users\Nathan\Documents\It-Takes-a-Village\Assets\Sisus\Power Inspector\Code\Editor\Drawers\Utility\ParentDrawerUtility.cs:2488
    8. UnityEngine.Debug:LogError (object)
    9. Sisus.ParentDrawerUtility:BuildMembers (Sisus.IDrawerProvider,Sisus.IParentDrawer,System.Collections.Generic.List`1<Sisus.LinkedMemberInfo>,System.Collections.Generic.List`1<Sisus.IDrawer>) (at Assets/Sisus/Power Inspector/Code/Editor/Drawers/Utility/ParentDrawerUtility.cs:2498)
    10. Sisus.ParentDrawerUtility:BuildMembers (Sisus.IDrawerProvider,Sisus.IParentDrawer,System.Collections.Generic.List`1<Sisus.LinkedMemberInfo>,Sisus.IDrawer[]&) (at Assets/Sisus/Power Inspector/Code/Editor/Drawers/Utility/ParentDrawerUtility.cs:2431)
    11. Sisus.UnityObjectDrawer`2<Sisus.ComponentDrawer, UnityEngine.Component>:DoBuildMembers () (at Assets/Sisus/Power Inspector/Code/Editor/Drawers/UnityObject/UnityObjectDrawer.cs:1928)
    12. Sisus.ParentDrawer`1<Sisus.LinkedMemberInfo>:BuildMembers () (at Assets/Sisus/Power Inspector/Code/Editor/Drawers/ParentDrawer.cs:461)
    13. Sisus.ParentDrawer`1<Sisus.LinkedMemberInfo>:LateSetup () (at Assets/Sisus/Power Inspector/Code/Editor/Drawers/ParentDrawer.cs:440)
    14. Sisus.UnityObjectDrawer`2<Sisus.ComponentDrawer, UnityEngine.Component>:LateSetup () (at Assets/Sisus/Power Inspector/Code/Editor/Drawers/UnityObject/UnityObjectDrawer.cs:1107)
    15. Sisus.DrawerProviderBase:GetForComponents (System.Type,UnityEngine.Component[],Sisus.IParentDrawer,Sisus.IInspector) (at Assets/Sisus/Power Inspector/Code/Editor/Drawers/Provider/DrawerProviderBase.cs:395)
    16. Sisus.DrawerProviderBase:GetForComponents (Sisus.IInspector,UnityEngine.Component[],Sisus.IParentDrawer) (at Assets/Sisus/Power Inspector/Code/Editor/Drawers/Provider/DrawerProviderBase.cs:376)
    17. Sisus.GameObjectDrawer:DoBuildMembers () (at Assets/Sisus/Power Inspector/Code/Editor/Drawers/UnityObject/GameObject/GameObjectDrawer.cs:1096)
    18. Sisus.ParentDrawer`1<UnityEngine.Component[]>:BuildMembers () (at Assets/Sisus/Power Inspector/Code/Editor/Drawers/ParentDrawer.cs:461)
    19. Sisus.ParentDrawer`1<UnityEngine.Component[]>:LateSetup () (at Assets/Sisus/Power Inspector/Code/Editor/Drawers/ParentDrawer.cs:440)
    20. Sisus.DrawerProviderBase:GetForGameObject (System.Type,Sisus.IInspector,UnityEngine.GameObject,Sisus.IParentDrawer) (at Assets/Sisus/Power Inspector/Code/Editor/Drawers/Provider/DrawerProviderBase.cs:322)
    21. Sisus.DrawerProviderBase:GetForGameObject (Sisus.IInspector,UnityEngine.GameObject,Sisus.IParentDrawer) (at Assets/Sisus/Power Inspector/Code/Editor/Drawers/Provider/DrawerProviderBase.cs:235)
    22. Sisus.Inspector`2<Sisus.PowerInspectorWindow, Sisus.PowerInspectorToolbar>:RebuildDrawers (UnityEngine.Object[],bool,bool,bool) (at Assets/Sisus/Power Inspector/Code/Editor/Inspector/Core/Inspector.cs:1354)
    23. Sisus.Inspector`2<Sisus.PowerInspectorWindow, Sisus.PowerInspectorToolbar>:RebuildDrawers (UnityEngine.Object[],bool) (at Assets/Sisus/Power Inspector/Code/Editor/Inspector/Core/Inspector.cs:1120)
    24. Sisus.Inspector`2<Sisus.PowerInspectorWindow, Sisus.PowerInspectorToolbar>:RebuildDrawers (bool,bool) (at Assets/Sisus/Power Inspector/Code/Editor/Inspector/Core/Inspector.cs:1021)
    25. Sisus.Inspector`2<Sisus.PowerInspectorWindow, Sisus.PowerInspectorToolbar>:RebuildDrawers (bool) (at Assets/Sisus/Power Inspector/Code/Editor/Inspector/Core/Inspector.cs:979)
    26. Sisus.Inspector`2<Sisus.PowerInspectorWindow, Sisus.PowerInspectorToolbar>:RebuildDrawersIfTargetsChanged () (at Assets/Sisus/Power Inspector/Code/Editor/Inspector/Core/Inspector.cs:973)
    27. Sisus.InspectorManager:OnLayout () (at Assets/Sisus/Power Inspector/Code/Editor/Inspector/Core/Manager/InspectorManager.cs:928)
    28. Sisus.InspectorUtility:BeginInspectorDrawer (Sisus.IInspectorDrawer,Sisus.ISplittableInspectorDrawer) (at Assets/Sisus/Power Inspector/Code/Editor/Inspector/Utility/InspectorUtility.cs:295)
    29. Sisus.InspectorDrawerWindow`2<Sisus.PowerInspectorWindow, Sisus.PowerInspector>:OnGUI () (at Assets/Sisus/Power Inspector/Code/Editor/EditorWindow/InspectorDrawerWindow.cs:2082)
    30. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
     
  3. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    887
    I've submitted a fix for the wrong sized GameObject header for review - it was working in 2023.1 and later, but version 2022.2 had slipped through. I adjusted the preprocessor directives to also include versions 2022.2 and later. Thanks for reporting this!

    That RangeDrawer.CreatePropertyGUI error indeed looks like it could be the reason for the property drawers being drawn in the wrong place. I'll do some testing with the RangeAttribute in Unity 2022.2 and figure out how to fix it.
     
  4. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    887
    @nghillaz I think the RangeDrawer error is happening because the RangeAttribute has been added to a field that is not serialized by Unity, and the RangeDrawer relies on using a SerializedProperty internally.

    To get around this, I'll add handling to Power Inspector to draw fields using their default drawer if constructing the property drawer based GUI should fail for any reason.
     
  5. nghillaz

    nghillaz

    Joined:
    Sep 4, 2014
    Posts:
    4
    Fix for the header size looks good! There's still some odd overlapped text at the top left though:

    upload_2023-2-9_13-35-57.png

    I believe this is an incompatibility with the Rewired asset, as it doesn't seem to happen for any other objects, and the Rewired inspector drawer doesn't render correctly.

    this is what it looks like in the standard inspector:
    upload_2023-2-9_13-37-7.png

    And in Power Inspector
    upload_2023-2-9_13-37-22.png

    This isn't a huge deal, as it only impacts one object in my scene, but just letting you know in case it might affect other types of component (and Rewired is basically a core Unity feature, so compatibility with it would be nice)
     
  6. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    887
    Thanks for the additional details @nghillaz ! I'll investigate and try and figure out what is causing the issues with Rewired.
     
  7. MikeChr

    MikeChr

    Joined:
    Feb 2, 2018
    Posts:
    34
    Hello. Just started with Power Inspector and find that my custom editors are not being displayed. I briefly look at the existing forum threads, but no joy. How to get custom editors to show up again? Thanks.
     
  8. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    887
  9. Nelsonlovey

    Nelsonlovey

    Joined:
    Aug 6, 2021
    Posts:
    1
    Hello,why i can not use [FoldoutGroup] Attribute in unity 2019.4.43.
     
  10. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    887
    Hey @Nelsonlovey ,

    Looks like there was an issue in the code for determining what drawer should be used for the FoldoutGroup attribute. There was an assumption in the code that Type.FullName would never return a null result - but turns out it actually can for open generic types!

    I'll submit an update to the asset store containing the fix and also send it your way in a PM.

    Thanks for letting me know about the issue!
     
  11. Slashbot64

    Slashbot64

    Joined:
    Jun 15, 2020
    Posts:
    193
    is this working in 2023.1.b7 seems like it doesn't wasn't sure.. no errors just inspector view doesn't change at all
     
  12. SisusCo

    SisusCo

    Joined:
    Jan 29, 2019
    Posts:
    887
    @Slashbot64 Just tested Power Inspector in 2023.1.b8 and everything looks to be working.

    Have you tried if restarting the editor or reinstalling Power Inspector helps?
     
  13. Slashbot64

    Slashbot64

    Joined:
    Jun 15, 2020
    Posts:
    193
    nvm it does work on b8.. deleting library folder helped it
     
    SisusCo likes this.