Skip to main content

Collider Raycaster Component

Overview​

This component allows Mouse Party to have multi-mouse interaction with Unity's Collider and Collider2D components causing standard MonoBehaviour mouse events to trigger such as MonoBehaviour.OnMouseEnter(), MonoBehaviour.OnMouseExit(), MonoBehaviour.OnMouseDown() etc.

Because the standard MonoBehaviour mouse events don't contain any information about which mouse caused the event, this component also supports Mouse Party events which do contain this information. To use these simply implement the events from the interfaces:

  • IMousePartyEnterHandler
  • IMousePartyExitHandler
  • IMousePartyOverHandler
  • IMousePartyDownHandler
  • IMousePartyUpHandler

Properties​

Component Screenshot

Property                            Type    Range    DefaultDescription
CameraCameranullThe camera to use for raycasting the cursors. If this is null, Camera.main will be used.
Layer3DLayerMaskThe layers to include in the raycasting for Collider objects.
Layer2DLayerMaskThe layers to include in the raycasting for Collider2D objects.
Max Raycast DistanceFloat100.0The maximum distance to raycast for Collider objects.
Emit Standard EventsBoolTrueCalls the MonoBehaviour methods such as OnMouseDown etc.
Emit Mouse Party EventsBoolTrueCalls the implemented Mouse Party events eg IMousePartyDownHandler.