Class ControlPanel
The control panel for labeler visualizers. This panel resides in the upper right hand corner of the display. Any UI element can be added to the panel, but it contains helper methods to quickly create some of the most common control panel display elements: toggles and sliders.
Inherited Members
Namespace: UnityEngine.Perception.GroundTruth
Assembly: solution.dll
Syntax
public class ControlPanel : MonoBehaviour
Properties
Name | Description |
---|---|
controls | Retrieves a list of the current controls in the control panel. |
Methods
Name | Description |
---|---|
AddNewControl(GameObject) | Adds a new UI control to the control panel. If the control cannot be added and the method will return false. Also, all UI elements must have a LayoutElement component and if they do not, this method will reject the new element, and return false. |
AddSliderControl(string, float, UnityAction<float>) | Creates a new slider control with the passed in name and default value. The slider's value runs from 0 to 1. The passed in listener will be called on slider changes. If anything goes wrong this method will return null. Returns the control panel element upon a successful add. |
AddToggleControl(string, UnityAction<bool>) | Creates a new toggle control with passed in name. The passed in listener will be called on toggle clicks. If anything goes wrong this method will return null. Returns the control panel element upon a successful add. |
RemoveControl(GameObject) | Removes the passed in component from the control panel. Returns false if the element does not exist. Returns true on a successful removal. The caller is responsible for destroying the control. |