bool WasClicked { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The WasClicked property is a static boolean property of the Gizmo class in the Sandbox namespace. It indicates whether the gizmo was clicked during the current frame. This property is useful for detecting user interactions with gizmos in a scene, allowing developers to respond to click events on gizmos.

Usage

To use the WasClicked property, simply access it directly from the Gizmo class. It returns a boolean value that is true if the gizmo was clicked in the current frame, and false otherwise.

Example

// Example of using the WasClicked property
if (Gizmo.WasClicked)
{
    // Handle the click event
    // For example, select the gizmo or perform an action
    HandleGizmoClick();
}

void HandleGizmoClick()
{
    // Implement the logic to handle the gizmo being clicked
    // This could involve selecting the gizmo, changing its properties, etc.
}