Revealed properties

Sometimes we might have a Prefab that we want to lock, but for which it would still make sense to surface a handful of properties and let the user override them. In addition, these properties might not be on the root object, or they might be part of a bigger component that we don't want to be fully editable. For this, BlackBox provides the ability to reveal properties.

What is a "revealed" property

Revealed properties are like shortcuts that show up in the BlackBox Inspector that link to properties on child objects. Even though it might look like it belongs to the BlackBox component, modifying one of these properties means modifying the original property.

As an example, let's imagine a Prefab that has a MeshRenderer component on one of its children, and we decide to reveal the Materials property of this component. Once we swap Material by dragging/dropping a new one, the familiar override blue line shows that we have created an override on the Materials property.

Opening the Overrides dropdown clearly shows that the override is sitting on the correct object (Barrel_A (1) in the image below), and not on the root (BarrelsStash). This means that if we were to Apply these changes, they would be applied to the correct sub-object.

Revealing properties

To get started, press the Show available properties button in the BlackBox component.

Under the button, a list of the GameObjects contained in the Prefab will show as toggles. By opening them, we will see the components belonging to those GameObjects. Opening them again displays the properties, which will show a preview but are not directly editable.

Press the [+] button on each property we want to reveal. The property will be added to a list at the top, and once added, we will be able to provide a name for it. This name will show up instead of the actual property name.

Revealed properties can be removed again by clicking on the [-] button.

Once we inspect the Prefab in the scene, any revealed property will show up in the Inspector of the BlackBox component using the custom name we have specified during their configuration, and will be editable now:

Tip: You don't need to lock a Prefab to be able to reveal properties.

You can in fact use this pattern only to highlight some properties you tweak often by surfacing them in the BlackBox component without hiding anything else.

Last updated