A BaseInputModule designed for mouse / keyboard / controller input.
Inheritance
MultipleRayInputModule
public class MultipleRayInputModule : RayInputModule, IUsesViewerScale, IFunctionalitySubscriber<IProvidesViewerScale>, IUsesPointer, IUsesConnectInterfaces, IFunctionalitySubscriber<IProvidesConnectInterfaces>, IProvidesAddRaycastSource, IProvidesIsHoveringOverUI, IUsesFunctionalityInjection, IFunctionalitySubscriber<IProvidesFunctionalityInjection>, IFunctionalitySubscriber, IProvidesBlockUIInteraction, IProvidesUIEvents, IProvidesGetRayEventData, IFunctionalityProvider
Properties
Declaration
public Camera eventCamera { get; set; }
Property Value
Force this module to be active.
Declaration
public bool forceModuleActive { get; set; }
Property Value
Number of keyboard / controller inputs allowed per second.
Declaration
public float inputActionsPerSecond { get; set; }
Property Value
Declaration
public LayerMask layerMask { get; set; }
Property Value
Type |
Description |
LayerMask |
|
Declaration
public Action<Transform> preProcessRaycastSource { set; }
Property Value
Type |
Description |
Action<Transform> |
|
Methods
Declaration
public override void ActivateModule()
Declaration
public void AddRaycastSource(IProxy proxy, Node node, Transform rayOrigin, Func<IRaycastSource, bool> validationCallback = null)
Parameters
Declaration
protected override void Awake()
Overrides
Declaration
public void ConnectSubscriber(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Implements
Declaration
public override void DeactivateModule()
Declaration
protected GameObject GetCurrentFocusedGameObject()
Returns
Type |
Description |
GameObject |
|
Declaration
public RayEventData GetPointerEventData(Transform rayOrigin)
Parameters
Type |
Name |
Description |
Transform |
rayOrigin |
|
Returns
Declaration
public bool IsHoveringOverUI(Transform rayOrigin)
Parameters
Type |
Name |
Description |
Transform |
rayOrigin |
|
Returns
Implements
Declaration
public override bool IsModuleSupported()
Returns
Declaration
public void LoadProvider()
Implements
Declaration
protected override void OnDestroy()
Declaration
public override void Process()
Declaration
protected void ProcessMouseEvent()
Process all mouse events.
Declaration
protected void ProcessMouseEvent(int id)
Parameters
Type |
Name |
Description |
Int32 |
id |
|
Calculate and process any mouse button state changes.
Declaration
protected void ProcessMousePress(RayInputModule.MouseButtonRayEventData data)
Parameters
This method is called by Unity whenever a touch event is processed. Override this method with a custom implementation to process touch events yourself.
Declaration
protected void ProcessTouchPress(RayEventData pointerEvent, bool pressed, bool released)
Parameters
Type |
Name |
Description |
RayEventData |
pointerEvent |
Event data relating to the touch event, such as position and ID to be passed to the touch event destination object.
|
Boolean |
pressed |
This is true for the first frame of a touch event, and false thereafter. This can therefore be used to determine the instant a touch event occurred.
|
Boolean |
released |
This is true only for the last frame of a touch event.
|
Calculate and send a move event to the current selected object.
Declaration
protected bool SendMoveEventToSelectedObject()
Returns
Type |
Description |
Boolean |
If the move event was used by the selected object.
|
Calculate and send a submit event to the current selected object.
Declaration
protected bool SendSubmitEventToSelectedObject()
Returns
Type |
Description |
Boolean |
If the submit event was used by the selected object.
|
Declaration
protected bool SendUpdateEventToSelectedObject()
Returns
Declaration
public void SetUIBlockedForRayOrigin(Transform rayOrigin, bool blocked)
Parameters
Type |
Name |
Description |
Transform |
rayOrigin |
|
Boolean |
blocked |
|
Implements
Declaration
public override bool ShouldActivateModule()
Returns
Declaration
Declaration
public void UnloadProvider()
Implements
Declaration
public override void UpdateModule()
Explicit Interface Implementations
Declaration
IProvidesConnectInterfaces IFunctionalitySubscriber<IProvidesConnectInterfaces>.provider { get; set; }
Returns
Implements
Declaration
IProvidesFunctionalityInjection IFunctionalitySubscriber<IProvidesFunctionalityInjection>.provider { get; set; }
Returns
Implements
Extension Methods
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.