# Methods

In addition to revealing [properties](https://tools.continis.io/black-box/main-features/reveal) and [entire components](https://tools.continis.io/black-box/main-features/reveal/entire-components), you can visualise buttons on a BlackBox to invoke public, parameter-less methods of any component:

<figure><img src="https://3055962393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzOOVmLdEeVhfPmrcckJe%2Fuploads%2Fez2MLN02muzyKWzOcWbR%2FAudioManager.png?alt=media&#x26;token=3fef0977-e242-4691-948b-4c3e9caaa790" alt="" width="563"><figcaption><p>This Prefab exposes three methods as buttons</p></figcaption></figure>

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:

<figure><img src="https://3055962393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzOOVmLdEeVhfPmrcckJe%2Fuploads%2FzHa7pKODwyhLh7j8jlvW%2FNothingRevealedInList.png?alt=media&#x26;token=1b9777c8-536e-4353-bb4d-97ff915ba912" alt="" width="506"><figcaption></figcaption></figure>

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]**:

<figure><img src="https://3055962393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzOOVmLdEeVhfPmrcckJe%2Fuploads%2FJA5POyjsMz7YmMA3Eh1S%2FMethods_Available.png?alt=media&#x26;token=e7659a27-e4fe-4b46-b161-ef0b5b1bf84b" alt="" width="563"><figcaption><p>Methods available are denoted by an M icon</p></figcaption></figure>

{% hint style="warning" %}
Note that only methods with no parameters will show up in the list. To invoke a method with parameters, consider [revealing UnityEvents](https://tools.continis.io/black-box/main-features/reveal/properties/unityevents-as-buttons) as a button instead.
{% endhint %}

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

<figure><img src="https://3055962393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzOOVmLdEeVhfPmrcckJe%2Fuploads%2FkSAyPLas8hovbFFxeS6r%2FMethodsInternal.png?alt=media&#x26;token=d7e6f183-3864-4dd9-88aa-d537e23c6979" alt="" width="563"><figcaption><p>Two methods have been revealed</p></figcaption></figure>

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.
