Class ConnectionEditor
The base editor for Connection instances.
Inherited Members
Namespace: Unity.LiveCapture.Editor
Assembly: Unity.LiveCapture.Editor.dll
Syntax
[CustomEditor(typeof(Connection), true)]
public class ConnectionEditor : Editor
Remarks
Inherit from this class when implementing the editor for a custom Connection.
Methods
CreateIMGUIContainer(Action)
Return this in CreateInfoGUI() and CreateSettingsGUI() to implement your UI with IMGUI instead of UI Toolkit.
// Define a void function containing the IMGUI code:
void OnGUI()
{
EditorGUILayout.Toggle(myContent, myValue);
}
// ...
// In CreateInfoGUI or CreateSettingsGUI:
return CreateIMGUIContainer(OnGUI);
Declaration
protected IMGUIContainer CreateIMGUIContainer(Action onGUIHandler)
Parameters
Type | Name | Description |
---|---|---|
Action | onGUIHandler | The function that's called to render and handle IMGUI events for the container. |
Returns
Type | Description |
---|---|
IMGUIContainer | An IMGUIContainer with the standard spacing and indentation for the ConnectionsWindow. |
CreateInfoGUI()
Creates the info contents for this Connection. Override to implement your UI.
Declaration
protected virtual VisualElement CreateInfoGUI()
Returns
Type | Description |
---|---|
VisualElement | The contents to display in the left/top pane of the ConnectionsWindow under the Connection's toolbar. |
Remarks
Use IndentContent and SpaceContent USS classes to add a consistent padding to its elements.
See Also
CreateSettingsGUI()
Creates the contents of the editable settings for this Connection. Override to implement your UI.
Declaration
protected virtual VisualElement CreateSettingsGUI()
Returns
Type | Description |
---|---|
VisualElement | The contents to display in the right/bottom pane of the ConnectionsWindow when this connection is selected for inspection. |
Remarks
Use IndentContent and SpaceContent USS classes to add a consistent padding to its elements.
See Also
GetToolbar()
Gets the toolbar that represents this Connection in the top/left pane of the ConnectionsWindow.
Declaration
protected ConnectionEditor.IToolbarUI GetToolbar()
Returns
Type | Description |
---|---|
ConnectionEditor.IToolbarUI | The cached toolbar object. |
OnConnectionChanged()
Called when the Connection referenced by Editor.target is modified. Override this function to update UI data based on the Connection.
Declaration
protected virtual void OnConnectionChanged()
OnDestroy()
Automatically removes the elements created by CreateInfoGUI() and CreateSettingsGUI() from the hierarchy.
Declaration
protected virtual void OnDestroy()
OnEnable()
Initializes the connection inspector.
Declaration
protected virtual void OnEnable()
StartInspection()
Called by ConnectionsWindow when this Connection is selected for inspection.
Declaration
protected virtual void StartInspection()
StopInspection()
Called by ConnectionsWindow when this Connection is no longer selected for inspection.
Declaration
protected virtual void StopInspection()