‎ ‎
On the Asset Store
BlackBox
BlackBox
  • Intro
  • Changelog
  • Troubleshooting
  • Main features
    • Locking Prefabs
      • Temp Unlock
      • Extra locking options
    • Reveal
      • Properties
        • UnityEvents as buttons
      • Entire components
      • Object references
      • Methods
      • Reveal lists
    • Disable Apply
  • Integrations
    • Odin Inspector
  • Other
    • Selection type
    • Project Settings
Powered by GitBook
On this page
  1. Main features
  2. Reveal

Methods

Last updated 5 months ago

In addition to revealing and , you can visualise buttons on a BlackBox to invoke public, parameter-less methods of any component:

This can be useful to invoke editor-time functionality directly from a Prefab's root, like baking a Navmesh, randomising the position of children objects programmatically, etc.

Revealing methods on the BlackBox

Like for properties, exposing methods can be done from the BlackBox component by entering Prefab Mode, and clicking on the Show available properties button:

This exposes the list of children and all of their components. Open a component to visualise another foldout called Public methods. Open this one to display all available public methods, which are preceded by a tiny [M]:

Press on the [+] button to add the method to the reveal list:

Here you can customise the button's label, just like it's done for properties, and remove them again with the [-] button.

Now, by exiting Prefab Mode, you will be able to see the buttons on the Prefab, and click them both in Edit and Play mode.

Note that only methods with no parameters will show up in the list. To invoke a method with parameters, consider as a button instead.

revealing UnityEvents
properties
entire components
This Prefab exposes three methods as buttons
Methods available are denoted by an M icon
Two methods have been revealed