Description
The State
property of the SceneViewportWidget
class represents the current state of the viewport within the editor. This property is of type ViewportState
, which is an enumeration that defines various states the viewport can be in, such as active, inactive, or any other custom states defined within the ViewportState
enum.
Usage
Use the State
property to get or set the current state of the SceneViewportWidget
. This can be useful for determining the current mode of the viewport or for changing its state programmatically based on user interactions or other conditions within the editor.
Example
// Example of accessing the State property
Editor.SceneViewportWidget viewportWidget = new Editor.SceneViewportWidget();
// Get the current state of the viewport
Editor.SceneViewportWidget.ViewportState currentState = viewportWidget.State;
// Set the viewport to a new state
viewportWidget.State = Editor.SceneViewportWidget.ViewportState.Active;