Description
The SceneOverlay
property of the EditorTool
class provides access to a widget that overlays the scene view in the editor. This widget can be used to display additional information or controls directly within the scene view, enhancing the user interface and interaction capabilities of the editor tool.
Usage
To use the SceneOverlay
property, you can access it directly from an instance of an EditorTool
subclass. This property is read-only and returns an Editor.Widget
object, which can be customized to fit the needs of your tool.
Note that this property is marked with the JsonIgnore
attribute, indicating that it will not be serialized when the object is converted to JSON. This is typically used to prevent circular references or to exclude properties that are not relevant for serialization.
Example
// Example of accessing the SceneOverlay property in a custom EditorTool
public class MyCustomTool : EditorTool
{
public override void OnEnabled()
{
base.OnEnabled();
// Access the SceneOverlay widget
Editor.Widget overlayWidget = this.SceneOverlay;
// Customize the overlay widget as needed
// For example, adding a button or label
overlayWidget.AddChild(new Editor.Button("Click Me"));
}
}