Interface IXRInteractionOverrideGroup
An interface that represents an Interaction Group component that is capable of overriding the interaction of the activeInteractor when another interactor tries to select any of the interactables being hovered or selected. An interactor can only override interaction when it is or is contained within a Group member that is configured as a possible override for the active Group member.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Interactors
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[MovedFrom("UnityEngine.XR.Interaction.Toolkit")]
public interface IXRInteractionOverrideGroup : IXRInteractionGroup
Methods
AddInteractionOverrideForGroupMember(IXRGroupMember, IXRGroupMember)
Adds overrideGroupMember
as a possible interaction override for sourceGroupMember
.
Declaration
void AddInteractionOverrideForGroupMember(IXRGroupMember sourceGroupMember, IXRGroupMember overrideGroupMember)
Parameters
Type | Name | Description |
---|---|---|
IXRGroupMember | sourceGroupMember | The Group member whose interaction can be potentially overridden by |
IXRGroupMember | overrideGroupMember | The Group member to add as a possible interaction override. |
Remarks
Both members must be registered with the Group. Additionally, overrideGroupMember
must
implement either IXRSelectInteractor or IXRInteractionOverrideGroup.
This method must not create a loop in the chain of overrides for sourceGroupMember
. Use the
implementation of GroupMemberIsPartOfOverrideChain(IXRGroupMember, IXRGroupMember) to ensure there is no loop before adding override.
See Also
ClearInteractionOverridesForGroupMember(IXRGroupMember)
Clears the set of possible interaction overrides for sourceGroupMember
.
Declaration
bool ClearInteractionOverridesForGroupMember(IXRGroupMember sourceGroupMember)
Parameters
Type | Name | Description |
---|---|---|
IXRGroupMember | sourceGroupMember | The Group member whose interaction can no longer be overridden. |
Returns
Type | Description |
---|---|
bool | Returns true if there is a set of overrides for |
Remarks
sourceGroupMember
must be registered with the Group.
See Also
GetInteractionOverridesForGroupMember(IXRGroupMember, HashSet<IXRGroupMember>)
Returns all members in the set of possible interaction overrides for sourceGroupMember
into set results
.
Declaration
void GetInteractionOverridesForGroupMember(IXRGroupMember sourceGroupMember, HashSet<IXRGroupMember> results)
Parameters
Type | Name | Description |
---|---|---|
IXRGroupMember | sourceGroupMember | The Group member whose overrides to get. |
HashSet<IXRGroupMember> | results | Set to receive override Group members. |
Remarks
sourceGroupMember
must be registered with the Group.
This method populates the set with the Group members at the time the method is called. It is not a live view,
meaning override Group members added or removed afterward will not be reflected in the results of this method.
Clears results
before adding to it.
See Also
GroupMemberIsPartOfOverrideChain(IXRGroupMember, IXRGroupMember)
Checks whether potentialOverrideGroupMember
is either the same as sourceGroupMember
or part of a chain of its override Group members and their overrides.
Declaration
bool GroupMemberIsPartOfOverrideChain(IXRGroupMember sourceGroupMember, IXRGroupMember potentialOverrideGroupMember)
Parameters
Type | Name | Description |
---|---|---|
IXRGroupMember | sourceGroupMember | The source Group member for the potential chain of override members. |
IXRGroupMember | potentialOverrideGroupMember | The Group member to check for as part of a chain of overrides. |
Returns
Type | Description |
---|---|
bool | Returns true if |
See Also
RemoveInteractionOverrideForGroupMember(IXRGroupMember, IXRGroupMember)
Removes overrideGroupMember
as a possible interaction override for sourceGroupMember
.
Declaration
bool RemoveInteractionOverrideForGroupMember(IXRGroupMember sourceGroupMember, IXRGroupMember overrideGroupMember)
Parameters
Type | Name | Description |
---|---|---|
IXRGroupMember | sourceGroupMember | The Group member whose interaction can no longer be overridden by |
IXRGroupMember | overrideGroupMember | The Group member to remove as a possible interaction override. |
Returns
Type | Description |
---|---|
bool | Returns true if |
Remarks
sourceGroupMember
must be registered with the Group.
See Also
ShouldAnyMemberOverrideInteraction(IXRInteractor, out IXRSelectInteractor)
Checks whether any member of the Group should override the interactions of interactingInteractor
.
An interactor should only override if it is capable of selecting any interactable that interactingInteractor
is interacting with. If multiple Group members are capable of overriding, only the highest priority one should override.
Declaration
bool ShouldAnyMemberOverrideInteraction(IXRInteractor interactingInteractor, out IXRSelectInteractor overridingInteractor)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactingInteractor | The interactor that is interacting with an interactable. |
IXRSelectInteractor | overridingInteractor | The interactor that should override interaction. |
Returns
Type | Description |
---|---|
bool | Returns true if any member of the Group should override the interactions of
|
Remarks
The implementation of this method should call this method on each Group member that is an IXRInteractionOverrideGroup.
See Also
ShouldOverrideActiveInteraction(out IXRSelectInteractor)
Checks whether the Group should end the interactions of the activeInteractor and instead prioritize an override interactor for interaction. An interactor should only override if it exists in the set of override Group members for the active member and is capable of selecting any interactable that activeInteractor is interacting with. If multiple Group members are capable of overriding, only the highest priority one should override.
Declaration
bool ShouldOverrideActiveInteraction(out IXRSelectInteractor overridingInteractor)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | overridingInteractor | The interactor that should override interaction. |
Returns
Type | Description |
---|---|
bool | Returns true if the Group should end the interactions of the activeInteractor and instead prioritize an override interactor for interaction. Otherwise, returns false. |
Remarks
The implementation of UpdateGroupMemberInteractions(IXRInteractor, out IXRInteractor)
should call this method at the start to determine whether overridingInteractor
should
override the pre-prioritized interactor.
The implementation of this method should call ShouldAnyMemberOverrideInteraction(IXRInteractor, out IXRSelectInteractor) on each
override Group member that is an IXRInteractionOverrideGroup.