_candidate
: TInteractable |
Signature
TInteractable _candidate |
_interactable
: TInteractable |
Signature
TInteractable _interactable |
_nativeId
: ulong |
Signature
ulong _nativeId |
_selectedInteractable
: TInteractable |
Signature
TInteractable _selectedInteractable |
_started
: bool |
Signature
bool _started |
Selector
: ISelector
[Get][Set] |
Signature
ISelector Selector |
Candidate
: TInteractable
[Get] |
The current interaction candidate.
This is the TInteractable with which this interactor can, but may not yet have begun to, interact.
The candidate is primarily used by the interactor itself (as the thing it knows it can interact with next) and by containing interactor groups, which frequently use the availability or unavailability of a candidate in a given frame to assess which interactors should perform the interactions of which they're capable.
Signature
TInteractable Candidate |
CandidateProperties
: object
[Get] |
Implementation of IInteractorView.CandidateProperties; for details, please refer to the related documentation provided for that interface.
Signature
virtual object CandidateProperties |
Data
: object
[Get] |
Implementation of IInteractorView.Data; for details, please refer to the related documentation provided for that interface.
Signature
object Data |
HasCandidate
: bool
[Get] |
Implementation of IInteractorView.HasCandidate; for details, please refer to the related documentation provided for that interface.
Signature
bool HasCandidate |
HasInteractable
: bool
[Get] |
Implementation of IInteractorView.HasInteractable; for details, please refer to the related documentation provided for that interface.
Signature
bool HasInteractable |
HasSelectedInteractable
: bool
[Get] |
Implementation of IInteractorView.HasSelectedInteractable; for details, please refer to the related documentation provided for that interface.
Signature
bool HasSelectedInteractable |
Identifier
: int
[Get] |
Implementation of IInteractorView.Identifier; for details, please refer to the related documentation provided for that interface.
Signature
int Identifier |
Interactable
: TInteractable
[Get] |
The TInteractable with which this interactor is currently interacting.
This may or may not be the same as the Candidate
Signature
TInteractable Interactable |
IsRootDriver
: bool
[Get][Set] |
Implementation of IUpdateDriver.IsRootDriver; for details, please refer to the related documentation provided for that interface.
Signature
bool IsRootDriver |
MaxIterationsPerFrame
: int
[Get][Set] |
This is an internal API which sets or retrieves the maximum number of times the interactor group will execute its processing loop (assessing and enacting changes in the groups InteractorState, among other effects) within a single frame.
The implications of this are complex, and depending on or modifying this value is not recommended.
Signature
int MaxIterationsPerFrame |
SelectedInteractable
: TInteractable
[Get] |
The TInteractable which this interactor is currently selecting.
This must be the same as Interactable, and neither SelectedInteractable nor Interactable will change value until this interactor unselects.
Signature
TInteractable SelectedInteractable |
ShouldHover
: bool
[Get] |
Implementation of IInteractor.ShouldHover; for details, please refer to the related documentation provided for that interface.
Signature
virtual bool ShouldHover |
ShouldSelect
: bool
[Get] |
Implementation of IInteractor.ShouldSelect; for details, please refer to the related documentation provided for that interface.
Signature
bool ShouldSelect |
ShouldUnhover
: bool
[Get] |
Implementation of IInteractor.ShouldUnhover; for details, please refer to the related documentation provided for that interface.
Signature
virtual bool ShouldUnhover |
ShouldUnselect
: bool
[Get] |
Implementation of IInteractor.ShouldUnselect; for details, please refer to the related documentation provided for that interface.
Signature
bool ShouldUnselect |
State
: InteractorState
[Get] |
Implementation of IInteractorView.State; for details, please refer to the related documentation provided for that interface.
Signature
InteractorState State |
WhenInteractableSelected
: MAction< TInteractable >
[Get] |
An event indicating that a new value is available via SelectedInteractable.
In terms of InteractorState, this occurs when the interactor begins selecting a new interactable.
Signature
MAction<TInteractable> WhenInteractableSelected |
WhenInteractableSet
: MAction< TInteractable >
[Get] |
An event indicating that a new value is available via Interactable.
In terms of InteractorState, this occurs when the interactor begins hovering a new interactable.
Signature
MAction<TInteractable> WhenInteractableSet |
WhenInteractableUnselected
: MAction< TInteractable >
[Get] |
An event indicating that SelectedInteractable will now return null.
In terms of InteractorState, this occurs when the interactor ceases selecting an interactable.
Signature
MAction<TInteractable> WhenInteractableUnselected |
WhenInteractableUnset
: MAction< TInteractable >
[Get] |
An event indicating that Interactable will now return null.
In terms of InteractorState, this occurs when the interactor ceases hovering an interactable.
Signature
MAction<TInteractable> WhenInteractableUnset |
WhenPostprocessed
: Action |
Implementation of IInteractorView.WhenPostprocessed; for details, please refer to the related documentation provided for that interface.
Signature
Action WhenPostprocessed |
WhenPreprocessed
: Action |
Implementation of IInteractorView.WhenPreprocessed; for details, please refer to the related documentation provided for that interface.
Signature
Action WhenPreprocessed |
WhenProcessed
: Action |
Implementation of IInteractorView.WhenProcessed; for details, please refer to the related documentation provided for that interface.
Signature
Action WhenProcessed |
WhenStateChanged
: Action< InteractorStateChangeArgs > |
Implementation of IInteractorView.WhenStateChanged; for details, please refer to the related documentation provided for that interface.
Signature
Action<InteractorStateChangeArgs> WhenStateChanged |
Awake
()
|
Signature
virtual void Awake() Returns void |
ComputeCandidate
()
|
Signature
abstract TInteractable ComputeCandidate() Returns abstract TInteractable |
ComputeCandidateTiebreaker
(
a
, b
)
|
Signature
virtual int ComputeCandidateTiebreaker(TInteractable a, TInteractable b) Parameters a: TInteractableb: TInteractableReturns int |
ComputeShouldSelect
()
|
Signature
virtual bool ComputeShouldSelect() Returns bool |
ComputeShouldUnselect
()
|
Signature
virtual bool ComputeShouldUnselect() Returns bool |
DoHoverUpdate
()
|
Signature
virtual void DoHoverUpdate() Returns void |
DoNormalUpdate
()
|
Signature
virtual void DoNormalUpdate() Returns void |
DoPostprocess
()
|
Signature
virtual void DoPostprocess() Returns void |
DoPreprocess
()
|
Signature
virtual void DoPreprocess() Returns void |
DoSelectUpdate
()
|
Signature
virtual void DoSelectUpdate() Returns void |
HandleDisabled
()
|
Signature
virtual void HandleDisabled() Returns void |
HandleEnabled
()
|
Signature
virtual void HandleEnabled() Returns void |
HandleSelected
()
|
Signature
virtual void HandleSelected() Returns void |
HandleUnselected
()
|
Signature
virtual void HandleUnselected() Returns void |
InteractableSelected
(
interactable
)
|
Signature
virtual void InteractableSelected(TInteractable interactable) Parameters interactable: TInteractableReturns void |
InteractableSet
(
interactable
)
|
Signature
virtual void InteractableSet(TInteractable interactable) Parameters interactable: TInteractableReturns void |
InteractableUnselected
(
interactable
)
|
Signature
virtual void InteractableUnselected(TInteractable interactable) Parameters interactable: TInteractableReturns void |
InteractableUnset
(
interactable
)
|
Signature
virtual void InteractableUnset(TInteractable interactable) Parameters interactable: TInteractableReturns void |
OnDestroy
()
|
Signature
virtual void OnDestroy() Returns void |
OnDisable
()
|
Signature
virtual void OnDisable() Returns void |
OnEnable
()
|
Signature
virtual void OnEnable() Returns void |
Start
()
|
Signature
virtual void Start() Returns void |
Update
()
|
Signature
virtual void Update() Returns void |
CanSelect
(
interactable
)
|
Determines if this interactor can interact with an interactable.
Despite its name, this method is not a part of the interactor processing flow alongside ShouldSelect and Select; both of those refer to things that respectively should and do happen now, as part of processing. CanSelect does not specifically test whether or not an interactable can be selected right now; for example, a grab interactor can only select interactables that are spatially nearby, but proximity is not taken into account at all by CanSelect. Rather, CanSelect assesses whether an interactable can be selected more generally, such as whether there are any special rules which should prevent the selection even if every other condition were satisfied. InteractableFilters are the primary form such selection-blocking rules take, but descendent classes can introduce any other type of selection blocker they wish by overriding CanSelect.
Signature
virtual bool CanSelect(TInteractable interactable) Parameters interactable: TInteractable
The interactable to check against.
Returns bool
True if the interactor can interact with the given interactable.
|
ClearComputeCandidateOverride
()
|
Clears the function provided in SetComputeCandidateOverride.
This is called when the interactor force releases an interactable.
Signature
virtual void ClearComputeCandidateOverride() Returns void |
ClearComputeShouldSelectOverride
()
|
Clears the function provided in SetComputeShouldSelectOverride.
This is called when the interactor force releases an interactable.
Signature
virtual void ClearComputeShouldSelectOverride() Returns void |
ClearComputeShouldUnselectOverride
()
|
Clears the function provided in SetComputeShouldUnselectOverride.
This is called when the interactor unselects an interactable.
Signature
virtual void ClearComputeShouldUnselectOverride() Returns void |
Disable
()
|
Implementation of IInteractor.Disable; for details, please refer to the related documentation provided for that interface.
Signature
void Disable() Returns void |
Drive
()
|
Implementation of IUpdateDriver.Drive.
This method should never be invoked directly by anything other than this instance (when IsRootDriver is true) or the IUpdateDriver serving the role of root driver.
This method encapsulates the entire processing flow of the interactor, invoking many of the core methods from IInteractor (Enable, Process, etc.) in the correct order and with the appropriate state management. Modification to or deviation from this flow very fundamentally changes how interactors work and is likely to result in undefined behavior. Consequently, neither directly invoking nor overriding this method is recommended.
Signature
virtual void Drive() Returns void |
Enable
()
|
Implementation of IInteractor.Enable; for details, please refer to the related documentation provided for that interface.
Signature
void Enable() Returns void |
Hover
()
|
Implementation of IInteractor.Hover; for details, please refer to the related documentation provided for that interface.
Signature
void Hover() Returns void |
InjectOptionalActiveState
(
activeState
)
|
Adds an IActiveStates to a dynamically instantiated Interactor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void InjectOptionalActiveState(IActiveState activeState) Parameters activeState: IActiveStateReturns void |
InjectOptionalCandidateTiebreaker
(
candidateTiebreaker
)
|
Adds an ICandidateComparers to a dynamically instantiated Interactor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void InjectOptionalCandidateTiebreaker(IComparer< TInteractable > candidateTiebreaker) Parameters candidateTiebreaker: IComparer< TInteractable >Returns void |
InjectOptionalData
(
data
)
|
Sets Data property on a dynamically instantiated Interactor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void InjectOptionalData(object data) Parameters data: objectReturns void |
InjectOptionalInteractableFilters
(
interactableFilters
)
|
Adds a set of IGameObjectFilters to a dynamically instantiated Interactor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void InjectOptionalInteractableFilters(List< IGameObjectFilter > interactableFilters) Parameters interactableFilters: List< IGameObjectFilter >Returns void |
InteractableChangesUpdate
()
|
Causes the interactor to unselect or unhover an interactable.
Called when an interactable is currently selected or hovered but a PointerEvent of type PointerEventType.Cancel occurs.
Signature
void InteractableChangesUpdate() Returns void |
Postprocess
()
|
Implementation of IInteractor.Process; executes any logic that should run after the interactor-specific logic.
Runs after both Preprocess and Process. This method should never be invoked directly except by either this interactor instance itself or the InteractorGroup to which it belongs.
Signature
void Postprocess() Returns void |
Preprocess
()
|
Implementation of IInteractor.Preprocess; executes any logic that should run before the interactor-specific logic.
Runs before Process and Postprocess. This method should never be invoked directly except by either this interactor instance itself or the InteractorGroup to which it belongs.
Signature
void Preprocess() Returns void |
Process
()
|
Implementation of IInteractor.Process; runs interactor-specific logic based on the interactor's current state.
Runs after Preprocess but before Postprocess. Can be called multiple times per interaction frame, with the number capped by the value of MaxIterationsPerFrame. This method should never be invoked directly except by either this interactor instance itself or the InteractorGroup to which it belongs.
Signature
void Process() Returns void |
ProcessCandidate
()
|
Implementation of IInteractor.ProcessCandidate; for details, please refer to the related documentation provided for that interface.
Signature
virtual void ProcessCandidate() Returns void |
Select
()
|
Implementation of IInteractor.Select; for details, please refer to the related documentation provided for that interface.
Signature
virtual void Select() Returns void |
SetComputeCandidateOverride
(
computeCandidate
, shouldClearOverrideOnSelect
)
|
Overrides the interactor's ComputeCandidate method with a new method.
ComputeCandidate is part of the core processing flow of IInteractors and is the primary way that individual interactors decide what they want to interact with. Computing a new candidate does not actually do the interaction because not all interaction candidates will result in interactions: an InteractorGroup might decide that one interactor's candidate cannot be acted upon because another interactor in the group is already interacting, for example. Managing this nuance, and the state associated with it, is why direct calls to methods like IInteractor.Hover cannot safely be used to force an interactor into a desired state, as attempting to do so violates the interactor's processing flow and may cause it to have invalid internal state. SetComputeCandidateOverride, however, can serve a similar function by arbitrarily controlling candidate discovery in the interactor. In this way, while an interactor still cannot be generally forced to interact with a specific candidate, it can be forced to consider a specific candidate within its proper processing flow, which unless prevented (by an intervening InteractorGroup, for example) can be made to result in the desired interaction.
Signature
virtual void SetComputeCandidateOverride(Func< TInteractable > computeCandidate, bool shouldClearOverrideOnSelect=true) Parameters computeCandidate: Func< TInteractable >
The method used instead of the interactable's existing ComputeCandidate() method.
shouldClearOverrideOnSelect: bool
If true, clear the computeCandidate function once you select an interactable.
Returns void |
SetComputeShouldSelectOverride
(
computeShouldSelect
, clearOverrideOnSelect
)
|
Overrides the interactor's ComputeShouldSelect() method with a new method.
For similar reasons to those discussed in the documentation for SetComputeCandidateOverride(Func<TInteractable>, bool), an interactor cannot be directly forced to select an interactable (except in special, bespoke methods such as HandGrab.HandGrabInteractor.ForceSelect(HandGrab.HandGrabInteractable, bool)), but the logic it uses to decide whether or not to select can be overriden so that its normal processing is guaranteed to result in selection (again, absent intervening forces such as an InteractorGroup).
Signature
virtual void SetComputeShouldSelectOverride(Func< bool > computeShouldSelect, bool clearOverrideOnSelect=true) Parameters computeShouldSelect: Func< bool >
The method used instead of the interactor's existing ComputeShouldSelect() method.
clearOverrideOnSelect: bool
If true, clear the computeShouldSelect function once you select an interactable.
Returns void |
SetComputeShouldUnselectOverride
(
computeShouldUnselect
, clearOverrideOnUnselect
)
|
Overrides the interactor's ComputeShouldUnselect method with a new method.
See SetComputeShouldSelectOverride(Func<bool>, bool) for relevant details
Signature
virtual void SetComputeShouldUnselectOverride(Func< bool > computeShouldUnselect, bool clearOverrideOnUnselect=true) Parameters computeShouldUnselect: Func< bool >
The method used instead of the interactor's existing ComputeShouldUnselect() method.
clearOverrideOnUnselect: bool
If true, clear the computeShouldUnselect function once you unselect an interactable.
Returns void |
Unhover
()
|
Implementation of IInteractor.Unhover; for details, please refer to the related documentation provided for that interface.
Signature
void Unhover() Returns void |
Unselect
()
|
Implementation of IInteractor.Unselect; for details, please refer to the related documentation provided for that interface.
Signature
virtual void Unselect() Returns void |