Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ClickedObject

The element directly under the cursor at the time of the right-click, or null when the click landed on empty space or on an element that is not exposed through the public API.
Read time 1 minuteLast updated 6 days ago

Definition

public object ClickedObject { get; }

Remarks

Test the runtime type to filter on a specific element kind, for example
context.ClickedObject is INode node
. Depending on the surface the handler is registered for, the value can be an INode, an IPort, a Wire, an IVariable, an IState, an ITransition or an ICondition. A subgraph state is an ISubgraphState, which derives from IState.
Elements with no public representation, such as placemats and sticky notes, also report
null
, so a
null
value does not guarantee the click landed on nothing.