11. Display Anything

  04. Features No Comments

Display Any Member

With Power Inspector the objective has been to be able to display anything you can think to throw at it.

Members That Power Inspector Can Display:

  • Fields
    • Serialized fields.
    • Non-serialized fields.
    • Fields with the readonly modifier.
    • Static Fields.
    • In Debug Mode+: fields with the HideInInspector attribute.
  • Properties
    • Auto-implemented properties.
    • Properties with asymmetric accessor visibility.
    • Properties with only the get accessor.
    • Properties with only the set accessor.
  • Methods
    • Instance methods.
    • Static methods.
    • Methods with parameters.
  • Indexers
    • Single-parameter indexers.
    • Multi-parameter indexers.

Types That Power Inspector Can Display

Power Inspector can display just about any Type imaginable.
Examples of supported types include:

  • Multi-Dimensional Array
  • Jagged Array
  • Dictionary
  • HashSet
  • Type
  • Delegate
  • Interface
  • Nullable
  • System.Object
  • DateTime
  • TimeSpan
    and many moreā€¦

To learn how you can control member visibility in Power Inspector refer to the class member visibility page.

Full Undo Support

Undo and redo works fully with these new types when you edit them through Power Inspector, even if Unity can’t handle serializing them.

Note About Serialization

Do note that even if a field is visible in Power Inspector does not necessarily mean that its value is serialized. If you add the ShowInInspector attribute to a non-serialized field you will see it in the inspector, but changes made to its value will still be lost whenever the scene is reloaded.

You can use the SerializeField and SerializeReference attributes to have Unity actually save the values of most fields for you. In the rare instances where Unity can’t handle the serialization (like with dictionaries) you’ll need to handle it manually.