Manages a group of interactors where only the first interactor requesting hover is allowed to enter the hover state.
This class ensures that all other interactors remain disabled for hover until the first interactor ceases to hover.
This class is typically used in scenarios where exclusive access by the first interactor is required to prevent conflicts. The priority is determined by the order of interaction requests; the first interactor to request hover gains priority. The group typically includes interactors such as the PokeInteractor and GrabInteractor.
Properties
override bool ShouldHover[Get]
Determines whether any interactor in the group should be in the hover state.
True if the state is InteractorState.Normal and any interactor meets the hover criteria; otherwise, false.
override bool ShouldUnhover[Get]
Determines whether the currently hovering interactor should exit the InteractorState.Hover state based on its current conditions.
This method checks if the state is hover and if the best interactor should cease hovering, ensuring proper state transitions.
override bool ShouldSelect[Get]
Determines whether the currently hovering interactor should transition to the select state based on its conditions.
This method checks if the state is hover and if the best interactor meets the criteria to be selected, managing interaction flow.
override bool ShouldUnselect[Get]
Determines whether the currently selected interactor should exit the InteractorState.Select state based on its current conditions.
This method checks if the state is select and if the best interactor should cease being selected, ensuring correct InteractorState management.
override bool HasCandidate[Get]
Determines if there is a candidate interactor that could potentially become the best interactor.
This property is essential for identifying potential interactors that can take over interaction responsibilities.
override bool HasInteractable[Get]
Checks if there is an interactable object associated with the best interactor.
This property is crucial for determining if the current best interactor is interacting with an object.
override bool HasSelectedInteractable[Get]
Checks if there is a selected interactable object associated with the best interactor.
This property is important for understanding if the current best interactor has successfully selected an object.
override object CandidateProperties[Get]
Retrieves properties of the candidate interactor, if available, which is crucial for further processing or decision-making.
This property provides detailed information about the candidate, aiding in the selection process.
Member Functions
virtual override void Hover ( )
Attempts to transition the first eligible interactor into the InteractorState.Hover state if conditions are met.
This method triggers the hover action and updates the state to hover if the attempt is successful, facilitating interaction initiation.
virtual override void Unhover ( )
Implementation of IInteractor.Unhover; for details, please refer to the related documentation provided for that interface.
virtual override void Select ( )
Implementation of IInteractor.Select; for details, please refer to the related documentation provided for that interface.
virtual override void Unselect ( )
Implementation of IInteractor.ShouldUnselect; for details, please refer to the related documentation provided for that interface.
virtual override void Preprocess ( )
Processes the interactor group before the main interaction logic.
This method ensures that the best candidate for interaction is processed if no interactor is currently selected or hovering.
virtual override void Enable ( )
Enables the interactor group, allowing interactions to be processed, which is essential for dynamic interaction environments.
If a best interactor is already determined, it will be enabled; otherwise, the base enable logic is applied.
virtual override void Disable ( )
Disables the interactor group, preventing any further interactions and cleaning up any state related to the best interactor.
This method is crucial for resetting the interactor group and avoiding unintended interactions.