Description
The HasClicked
property is a static boolean property of the Gizmo
class in the Sandbox namespace. It indicates whether a gizmo has been 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
Use the HasClicked
property to check if a gizmo has been clicked in the current frame. This can be particularly useful in scenarios where you need to trigger actions or changes in response to user clicks on gizmos.
Since HasClicked
is a static property, you can access it directly through the Gizmo
class without needing an instance of the class.
Example
// Example usage of Gizmo.HasClicked
if (Gizmo.HasClicked)
{
// Perform an action when a gizmo is clicked
// For example, select the gizmo or trigger an event
HandleGizmoClick();
}
void HandleGizmoClick()
{
// Implement the logic to handle the gizmo click
// This could involve selecting the gizmo, changing its properties, etc.
}