Properties
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 (the MeshRenderer component, in the image below), and not on the BlackBox component.
This means that if we were to Apply these changes, they would be applied to the correct sub-object.
Revealing properties
There are two ways to reveal a property:
On the BlackBox component
To get started, press the Show Available Properties and Methods button in the BlackBox
component:
Under the button, a list of the GameObjects contained in the Prefab will show as foldouts. By opening them, you will see the components belonging to those GameObjects. Opening them again displays the properties, which will show a preview of the current value.
Properties are preceded by a small [P] letter, like the Mesh
property on the MeshFilter
here:
More than just properties
You probably noticed in the screenshot above how – in addition to individual properties - public methods [M] and entire components [C] can also be revealed.
Press the [+] button on each property you want to reveal. The property will be added to a list at the top, and once added, you 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:
Do your scripts have tons of properties?
When you expand a dropdown, immediately under the Entire Component line, you'll see a line called All properties individually. By clicking this button, all of the component's properties will be revealed individually. This means that later on you can refine the list and just remove a few, if you need to.
Revealing properties in bulk like this can really speed up Prefab setup in case of complex scripts.
Via the context menu
In addition to the above, there is a quick and handy way to reveal a property. Just navigate to the Component that contains that property, right-click on it. Under the menu BlackBox, you can choose which list to reveal the property in:
Done!
Not all properties can be revealed this way. If you right-click on one and you don't see the option, you have to reveal it using the method described in the previous section.
All properties individually via the context menu
Just like individual properties, it's possible to reveal all properties of a component at once by right-clicking on the component's header, and choosing BlackBox > All Properties > Reveal in..., choosing then which Reveal list you want to add the properties to.
First List, Second List... what are they?
Unfortunately, a Unity limitation means we can't display the custom names that you might have assigned to Reveal lists, and that's why they are displayed as First List, Second List, etc. up to 5 lists.
To add properties to a higher number list, you can move the list in one of the first 5 positions, add the properties, and move it back (using the reorder buttons in Edit mode).
Last updated