using System; using System.Collections.Generic; using UnityEngine.XR.Interaction.Toolkit.Interactables; using UnityEngine.XR.Interaction.Toolkit.Interactors; namespace UnityEngine.XR.Interaction.Toolkit { public partial class XRInteractionManager { const string k_RegisterInteractorDeprecated = "RegisterInteractor(XRBaseInteractor) has been deprecated. Use RegisterInteractor(IXRInteractor) instead. You may need to modify your code by casting the argument to call the intended method, such as `RegisterInteractor((IXRInteractor)this)` instead."; const string k_UnregisterInteractorDeprecated = "UnregisterInteractor(XRBaseInteractor) has been deprecated. Use UnregisterInteractor(IXRInteractor) instead. You may need to modify your code by casting the argument to call the intended method, such as `UnregisterInteractor((IXRInteractor)this)` instead."; const string k_RegisterInteractableDeprecated = "RegisterInteractable(XRBaseInteractable) has been deprecated. Use RegisterInteractable(IXRInteractable) instead. You may need to modify your code by casting the argument to call the intended method, such as `RegisterInteractable((IXRInteractable)this)` instead."; const string k_UnregisterInteractableDeprecated = "UnregisterInteractable(XRBaseInteractable) has been deprecated. Use UnregisterInteractable(IXRInteractable) instead. You may need to modify your code by casting the argument to call the intended method, such as `UnregisterInteractable((IXRInteractable)this)` instead."; const string k_GetRegisteredInteractorsDeprecated = "GetRegisteredInteractors(List) has been deprecated. Use GetRegisteredInteractors(List) instead."; const string k_GetRegisteredInteractablesDeprecated = "GetRegisteredInteractables(List) has been deprecated. Use GetRegisteredInteractables(List) instead."; const string k_IsRegisteredInteractorDeprecated = "IsRegistered(XRBaseInteractor) has been deprecated. Use IsRegistered(IXRInteractor) instead. You may need to modify your code by casting the argument to call the intended method, such as `IsRegistered((IXRInteractor)this)` instead."; const string k_IsRegisteredInteractableDeprecated = "IsRegistered(XRBaseInteractable) has been deprecated. Use IsRegistered(IXRInteractable) instead. You may need to modify your code by casting the argument to call the intended method, such as `IsRegistered((IXRInteractable)this)` instead."; const string k_TryGetInteractableForColliderDeprecated = "TryGetInteractableForCollider has been deprecated. Use GetInteractableForCollider instead. (UnityUpgradable) -> GetInteractableForCollider(*)"; const string k_GetInteractableForColliderDeprecated = "GetInteractableForCollider has been deprecated. Use TryGetInteractableForCollider(Collider, out IXRInteractable) instead."; const string k_GetColliderToInteractableMapDeprecated = "GetColliderToInteractableMap has been deprecated. The signature no longer matches the field used by the XRInteractionManager, so a copy is returned instead of a ref. Changes to the returned Dictionary will not be observed by the XRInteractionManager."; const string k_GetValidTargetsDeprecated = "GetValidTargets(XRBaseInteractor, List) has been deprecated. Use GetValidTargets(IXRInteractor, List) instead."; const string k_ForceSelectDeprecated = "ForceSelect(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use SelectEnter(IXRSelectInteractor, IXRSelectInteractable) instead."; const string k_ClearInteractorSelectionDeprecated = "ClearInteractorSelection(XRBaseInteractor) has been deprecated. Use ClearInteractorSelection(IXRSelectInteractor, List) instead."; const string k_CancelInteractorSelectionDeprecated = "CancelInteractorSelection(XRBaseInteractor) has been deprecated. Use CancelInteractorSelection(IXRSelectInteractor) instead."; const string k_CancelInteractableSelectionDeprecated = "CancelInteractableSelection(XRBaseInteractable) has been deprecated. Use CancelInteractableSelection(IXRSelectInteractable) instead."; const string k_ClearInteractorHoverDeprecated = "ClearInteractorHover(XRBaseInteractor, List) has been deprecated. Use ClearInteractorHover(IXRHoverInteractor, List) instead."; const string k_CancelInteractorHoverDeprecated = "CancelInteractorHover(XRBaseInteractor) has been deprecated. Use CancelInteractorHover(IXRHoverInteractor) instead."; const string k_CancelInteractableHoverDeprecated = "CancelInteractableHover(XRBaseInteractable) has been deprecated. Use CancelInteractableHover(IXRHoverInteractable) instead."; const string k_SelectEnterDeprecated = "SelectEnter(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use SelectEnter(IXRSelectInteractor, IXRSelectInteractable) instead. You may need to modify your code by casting the argument to call the intended method, such as `SelectEnter((IXRSelectInteractor)interactor, (IXRSelectInteractable)interactable)` instead."; const string k_SelectExitDeprecated = "SelectExit(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use SelectExit(IXRSelectInteractor, IXRSelectInteractable) instead. You may need to modify your code by casting the argument to call the intended method, such as `SelectExit((IXRSelectInteractor)interactor, (IXRSelectInteractable)interactable)` instead."; const string k_SelectCancelDeprecated = "SelectCancel(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use SelectCancel(IXRSelectInteractor, IXRSelectInteractable) instead. You may need to modify your code by casting the argument to call the intended method, such as `SelectCancel((IXRSelectInteractor)interactor, (IXRSelectInteractable)interactable)` instead."; const string k_HoverEnterDeprecated = "HoverEnter(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use HoverEnter(IXRHoverInteractor, IXRHoverInteractable) instead. You may need to modify your code by casting the argument to call the intended method, such as `HoverEnter((IXRHoverInteractor)interactor, (IXRHoverInteractable)interactable)` instead."; const string k_HoverExitDeprecated = "HoverExit(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use HoverExit(IXRHoverInteractor, IXRHoverInteractable) instead. You may need to modify your code by casting the argument to call the intended method, such as `HoverExit((IXRHoverInteractor)interactor, (IXRHoverInteractable)interactable)` instead."; const string k_HoverCancelDeprecated = "HoverCancel(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use HoverCancel(IXRHoverInteractor, IXRHoverInteractable) instead. You may need to modify your code by casting the argument to call the intended method, such as `HoverCancel((IXRHoverInteractor)interactor, (IXRHoverInteractable)interactable)` instead."; const string k_SelectEnterProtectedDeprecated = "SelectEnter(XRBaseInteractor, XRBaseInteractable, SelectEnterEventArgs) has been deprecated. Use SelectEnter(IXRSelectInteractor, IXRSelectInteractable, SelectEnterEventArgs) instead."; const string k_SelectExitProtectedDeprecated = "SelectExit(XRBaseInteractor, XRBaseInteractable, SelectExitEventArgs) has been deprecated. Use SelectExit(IXRSelectInteractor, IXRSelectInteractable, SelectExitEventArgs) instead."; const string k_HoverEnterProtectedDeprecated = "HoverEnter(XRBaseInteractor, XRBaseInteractable, HoverEnterEventArgs) has been deprecated. Use HoverEnter(IXRHoverInteractor, IXRHoverInteractable, HoverEnterEventArgs) instead."; const string k_HoverExitProtectedDeprecated = "HoverExit(XRBaseInteractor, XRBaseInteractable, HoverExitEventArgs) has been deprecated. Use HoverExit(IXRHoverInteractor, IXRHoverInteractable, HoverExitEventArgs) instead."; const string k_InteractorSelectValidTargetsDeprecated = "InteractorSelectValidTargets(XRBaseInteractor, List) has been deprecated. Use InteractorSelectValidTargets(IXRSelectInteractor, List) instead."; const string k_InteractorHoverValidTargetsDeprecated = "InteractorHoverValidTargets(XRBaseInteractor, List) has been deprecated. Use InteractorHoverValidTargets(IXRHoverInteractor, List) instead."; /// /// /// RegisterInteractor(XRBaseInteractor) has been deprecated. Use instead. /// [Obsolete(k_RegisterInteractorDeprecated, true)] public virtual void RegisterInteractor(XRBaseInteractor interactor) { Debug.LogError(k_RegisterInteractorDeprecated, this); throw new NotSupportedException(k_RegisterInteractorDeprecated); } /// /// /// UnregisterInteractor(XRBaseInteractor) has been deprecated. Use instead. /// [Obsolete(k_UnregisterInteractorDeprecated, true)] public virtual void UnregisterInteractor(XRBaseInteractor interactor) { Debug.LogError(k_UnregisterInteractorDeprecated, this); throw new NotSupportedException(k_UnregisterInteractorDeprecated); } /// /// /// RegisterInteractable(XRBaseInteractable) has been deprecated. Use instead. /// [Obsolete(k_RegisterInteractableDeprecated, true)] public virtual void RegisterInteractable(XRBaseInteractable interactable) { Debug.LogError(k_RegisterInteractableDeprecated, this); throw new NotSupportedException(k_RegisterInteractableDeprecated); } /// /// /// UnregisterInteractable(XRBaseInteractable) has been deprecated. Use instead. /// [Obsolete(k_UnregisterInteractableDeprecated, true)] public virtual void UnregisterInteractable(XRBaseInteractable interactable) { Debug.LogError(k_UnregisterInteractableDeprecated, this); throw new NotSupportedException(k_UnregisterInteractableDeprecated); } /// /// /// GetRegisteredInteractors(List<XRBaseInteractor>) has been deprecated. Use instead. /// [Obsolete(k_GetRegisteredInteractorsDeprecated, true)] public void GetRegisteredInteractors(List results) { Debug.LogError(k_GetRegisteredInteractorsDeprecated, this); throw new NotSupportedException(k_GetRegisteredInteractorsDeprecated); } /// /// /// GetRegisteredInteractables(List<XRBaseInteractable>) has been deprecated. Use instead. /// [Obsolete(k_GetRegisteredInteractablesDeprecated, true)] public void GetRegisteredInteractables(List results) { Debug.LogError(k_GetRegisteredInteractablesDeprecated, this); throw new NotSupportedException(k_GetRegisteredInteractablesDeprecated); } /// /// /// IsRegistered(XRBaseInteractor) has been deprecated. Use instead. /// [Obsolete(k_IsRegisteredInteractorDeprecated, true)] public bool IsRegistered(XRBaseInteractor interactor) { Debug.LogError(k_IsRegisteredInteractorDeprecated, this); throw new NotSupportedException(k_IsRegisteredInteractorDeprecated); } /// /// /// IsRegistered(XRBaseInteractable) has been deprecated. Use instead. /// [Obsolete(k_IsRegisteredInteractableDeprecated, true)] public bool IsRegistered(XRBaseInteractable interactable) { Debug.LogError(k_IsRegisteredInteractableDeprecated, this); throw new NotSupportedException(k_IsRegisteredInteractableDeprecated); } /// /// /// TryGetInteractableForCollider has been deprecated. Use instead. /// [Obsolete(k_TryGetInteractableForColliderDeprecated, true)] public XRBaseInteractable TryGetInteractableForCollider(Collider interactableCollider) { Debug.LogError(k_TryGetInteractableForColliderDeprecated, this); throw new NotSupportedException(k_TryGetInteractableForColliderDeprecated); } /// /// Gets the Interactable a specific collider is attached to. /// /// The collider of the Interactable to retrieve. /// Returns the Interactable that the collider is attached to. Otherwise returns if no such Interactable exists. /// /// GetInteractableForCollider has been deprecated. Use instead. /// [Obsolete(k_GetInteractableForColliderDeprecated, true)] public XRBaseInteractable GetInteractableForCollider(Collider interactableCollider) { Debug.LogError(k_GetInteractableForColliderDeprecated, this); throw new NotSupportedException(k_GetInteractableForColliderDeprecated); } /// /// Gets the dictionary that has all the registered colliders and their associated Interactable. /// /// When this method returns, contains the dictionary that has all the registered colliders and their associated Interactable. /// /// Clears before adding to it. ///
/// GetColliderToInteractableMap has been deprecated. GetColliderToInteractableMap has been deprecated. The signature no longer matches the field used by the XRInteractionManager, so a copy is returned instead of a ref. Changes to the returned Dictionary will not be observed by the XRInteractionManager. ///
[Obsolete(k_GetColliderToInteractableMapDeprecated, true)] public void GetColliderToInteractableMap(ref Dictionary map) { Debug.LogError(k_GetColliderToInteractableMapDeprecated, this); throw new NotSupportedException(k_GetColliderToInteractableMapDeprecated); } /// /// For the provided , returns a list of the valid Interactables that can be hovered over or selected. /// /// The Interactor whose valid targets we want to find. /// List to be filled with valid targets of the Interactor. /// The list of valid targets of the Interactor. /// /// /// GetValidTargets(XRBaseInteractor, List<XRBaseInteractable>) has been deprecated. Use instead. /// [Obsolete(k_GetValidTargetsDeprecated, true)] public List GetValidTargets(XRBaseInteractor interactor, List validTargets) { Debug.LogError(k_GetValidTargetsDeprecated, this); throw new NotSupportedException(k_GetValidTargetsDeprecated); } /// /// Manually forces selection of an Interactable. This is different than starting manual interaction. /// /// The Interactor that will select the Interactable. /// The Interactable to be selected. /// /// ForceSelect(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use instead. /// [Obsolete(k_ForceSelectDeprecated, true)] public void ForceSelect(XRBaseInteractor interactor, XRBaseInteractable interactable) { Debug.LogError(k_ForceSelectDeprecated, this); throw new NotSupportedException(k_ForceSelectDeprecated); } /// /// Automatically called each frame during Update to clear the selection of the Interactor if necessary due to current conditions. /// /// The Interactor to potentially exit its selection state. /// /// ClearInteractorSelection(XRBaseInteractor) has been deprecated. Use instead. /// [Obsolete(k_ClearInteractorSelectionDeprecated, true)] public virtual void ClearInteractorSelection(XRBaseInteractor interactor) { Debug.LogError(k_ClearInteractorSelectionDeprecated, this); throw new NotSupportedException(k_ClearInteractorSelectionDeprecated); } /// /// Automatically called when an Interactor is unregistered to cancel the selection of the Interactor if necessary. /// /// The Interactor to potentially exit its selection state due to cancellation. /// /// CancelInteractorSelection(XRBaseInteractor) has been deprecated. Use instead. /// [Obsolete(k_CancelInteractorSelectionDeprecated, true)] public virtual void CancelInteractorSelection(XRBaseInteractor interactor) { Debug.LogError(k_CancelInteractorSelectionDeprecated, this); throw new NotSupportedException(k_CancelInteractorSelectionDeprecated); } /// /// Automatically called when an Interactable is unregistered to cancel the selection of the Interactable if necessary. /// /// The Interactable to potentially exit its selection state due to cancellation. /// /// CancelInteractableSelection(XRBaseInteractable) has been deprecated. Use instead. /// [Obsolete(k_CancelInteractableSelectionDeprecated, true)] public virtual void CancelInteractableSelection(XRBaseInteractable interactable) { Debug.LogError(k_CancelInteractableSelectionDeprecated, this); throw new NotSupportedException(k_CancelInteractableSelectionDeprecated); } /// /// Automatically called each frame during Update to clear the hover state of the Interactor if necessary due to current conditions. /// /// The Interactor to potentially exit its hover state. /// The list of interactables that this Interactor could possibly interact with this frame. /// /// ClearInteractorHover(XRBaseInteractor, List<XRBaseInteractable>) has been deprecated. Use instead. /// [Obsolete(k_ClearInteractorHoverDeprecated, true)] public virtual void ClearInteractorHover(XRBaseInteractor interactor, List validTargets) { Debug.LogError(k_ClearInteractorHoverDeprecated, this); throw new NotSupportedException(k_ClearInteractorHoverDeprecated); } /// /// Automatically called when an Interactor is unregistered to cancel the hover state of the Interactor if necessary. /// /// The Interactor to potentially exit its hover state due to cancellation. /// /// CancelInteractorHover(XRBaseInteractor) has been deprecated. Use instead. /// [Obsolete(k_CancelInteractorHoverDeprecated, true)] public virtual void CancelInteractorHover(XRBaseInteractor interactor) { Debug.LogError(k_CancelInteractorHoverDeprecated, this); throw new NotSupportedException(k_CancelInteractorHoverDeprecated); } /// /// Automatically called when an Interactable is unregistered to cancel the hover state of the Interactable if necessary. /// /// The Interactable to potentially exit its hover state due to cancellation. /// /// CancelInteractableHover(XRBaseInteractable) has been deprecated. Use instead. /// [Obsolete(k_CancelInteractableHoverDeprecated, true)] public virtual void CancelInteractableHover(XRBaseInteractable interactable) { Debug.LogError(k_CancelInteractableHoverDeprecated, this); throw new NotSupportedException(k_CancelInteractableHoverDeprecated); } /// /// Initiates selection of an Interactable by an Interactor. This method may first result in other interaction events /// such as causing the Interactable to first exit being selected. /// /// The Interactor that is selecting. /// The Interactable being selected. /// /// This attempt may be ignored depending on the selection policy of the Interactor and/or the Interactable. ///
/// SelectEnter(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use instead. ///
[Obsolete(k_SelectEnterDeprecated, true)] public virtual void SelectEnter(XRBaseInteractor interactor, XRBaseInteractable interactable) { Debug.LogError(k_SelectEnterDeprecated, this); throw new NotSupportedException(k_SelectEnterDeprecated); } /// /// Initiates ending selection of an Interactable by an Interactor. /// /// The Interactor that is no longer selecting. /// The Interactable that is no longer being selected. /// /// SelectExit(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use instead. /// [Obsolete(k_SelectExitDeprecated, true)] public virtual void SelectExit(XRBaseInteractor interactor, XRBaseInteractable interactable) { Debug.LogError(k_SelectExitDeprecated, this); throw new NotSupportedException(k_SelectExitDeprecated); } /// /// Initiates ending selection of an Interactable by an Interactor due to cancellation, /// such as from either being unregistered due to being disabled or destroyed. /// /// The Interactor that is no longer selecting. /// The Interactable that is no longer being selected. /// /// SelectCancel(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use instead. /// [Obsolete(k_SelectCancelDeprecated, true)] public virtual void SelectCancel(XRBaseInteractor interactor, XRBaseInteractable interactable) { Debug.LogError(k_SelectCancelDeprecated, this); throw new NotSupportedException(k_SelectCancelDeprecated); } /// /// Initiates hovering of an Interactable by an Interactor. /// /// The Interactor that is hovering. /// The Interactable being hovered over. /// /// HoverEnter(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use instead. /// [Obsolete(k_HoverEnterDeprecated, true)] public virtual void HoverEnter(XRBaseInteractor interactor, XRBaseInteractable interactable) { Debug.LogError(k_HoverEnterDeprecated, this); throw new NotSupportedException(k_HoverEnterDeprecated); } /// /// Initiates ending hovering of an Interactable by an Interactor. /// /// The Interactor that is no longer hovering. /// The Interactable that is no longer being hovered over. /// /// HoverExit(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use instead. /// [Obsolete(k_HoverExitDeprecated, true)] public virtual void HoverExit(XRBaseInteractor interactor, XRBaseInteractable interactable) { Debug.LogError(k_HoverExitDeprecated, this); throw new NotSupportedException(k_HoverExitDeprecated); } /// /// Initiates ending hovering of an Interactable by an Interactor due to cancellation, /// such as from either being unregistered due to being disabled or destroyed. /// /// The Interactor that is no longer hovering. /// The Interactable that is no longer being hovered over. /// /// HoverCancel(XRBaseInteractor, XRBaseInteractable) has been deprecated. Use instead. /// [Obsolete(k_HoverCancelDeprecated, true)] public virtual void HoverCancel(XRBaseInteractor interactor, XRBaseInteractable interactable) { Debug.LogError(k_HoverCancelDeprecated, this); throw new NotSupportedException(k_HoverCancelDeprecated); } /// /// Initiates selection of an Interactable by an Interactor, passing the given . /// /// The Interactor that is selecting. /// The Interactable being selected. /// Event data containing the Interactor and Interactable involved in the event. /// /// SelectExit(XRBaseInteractor, XRBaseInteractable, SelectExitEventArgs) has been deprecated. Use instead. /// [Obsolete(k_SelectEnterProtectedDeprecated, true)] protected virtual void SelectEnter(XRBaseInteractor interactor, XRBaseInteractable interactable, SelectEnterEventArgs args) { Debug.LogError(k_SelectEnterProtectedDeprecated, this); throw new NotSupportedException(k_SelectEnterProtectedDeprecated); } /// /// Initiates ending selection of an Interactable by an Interactor, passing the given . /// /// The Interactor that is no longer selecting. /// The Interactable that is no longer being selected. /// Event data containing the Interactor and Interactable involved in the event. /// /// SelectExit(XRBaseInteractor, XRBaseInteractable, SelectExitEventArgs) has been deprecated. Use instead. /// [Obsolete(k_SelectExitProtectedDeprecated, true)] protected virtual void SelectExit(XRBaseInteractor interactor, XRBaseInteractable interactable, SelectExitEventArgs args) { Debug.LogError(k_SelectExitProtectedDeprecated, this); throw new NotSupportedException(k_SelectExitProtectedDeprecated); } /// /// Initiates hovering of an Interactable by an Interactor, passing the given . /// /// The Interactor that is hovering. /// The Interactable being hovered over. /// Event data containing the Interactor and Interactable involved in the event. /// /// HoverEnter(XRBaseInteractor, XRBaseInteractable, HoverEnterEventArgs) has been deprecated. Use instead. /// [Obsolete(k_HoverEnterProtectedDeprecated, true)] protected virtual void HoverEnter(XRBaseInteractor interactor, XRBaseInteractable interactable, HoverEnterEventArgs args) { Debug.LogError(k_HoverEnterProtectedDeprecated, this); throw new NotSupportedException(k_HoverEnterProtectedDeprecated); } /// /// Initiates ending hovering of an Interactable by an Interactor, passing the given . /// /// The Interactor that is no longer hovering. /// The Interactable that is no longer being hovered over. /// Event data containing the Interactor and Interactable involved in the event. /// /// HoverExit(XRBaseInteractor, XRBaseInteractable, HoverExitEventArgs) has been deprecated. Use instead. /// [Obsolete(k_HoverExitProtectedDeprecated, true)] protected virtual void HoverExit(XRBaseInteractor interactor, XRBaseInteractable interactable, HoverExitEventArgs args) { Debug.LogError(k_HoverExitProtectedDeprecated, this); throw new NotSupportedException(k_HoverExitProtectedDeprecated); } /// /// Automatically called each frame during Update to enter the selection state of the Interactor if necessary due to current conditions. /// /// The Interactor to potentially enter its selection state. /// The list of interactables that this Interactor could possibly interact with this frame. /// /// InteractorSelectValidTargets(XRBaseInteractor, List<XRBaseInteractable>) has been deprecated. Use instead. /// [Obsolete(k_InteractorSelectValidTargetsDeprecated, true)] protected virtual void InteractorSelectValidTargets(XRBaseInteractor interactor, List validTargets) { Debug.LogError(k_InteractorSelectValidTargetsDeprecated, this); throw new NotSupportedException(k_InteractorSelectValidTargetsDeprecated); } /// /// Automatically called each frame during Update to enter the hover state of the Interactor if necessary due to current conditions. /// /// The Interactor to potentially enter its hover state. /// The list of interactables that this Interactor could possibly interact with this frame. /// /// InteractorHoverValidTargets(XRBaseInteractor, List<XRBaseInteractable>) has been deprecated. Use instead. /// [Obsolete(k_InteractorHoverValidTargetsDeprecated, true)] protected virtual void InteractorHoverValidTargets(XRBaseInteractor interactor, List validTargets) { Debug.LogError(k_InteractorHoverValidTargetsDeprecated, this); throw new NotSupportedException(k_InteractorHoverValidTargetsDeprecated); } } }