using System; namespace UnityEngine.XR.Interaction.Toolkit.Locomotion { public abstract partial class LocomotionProvider { /// /// (Deprecated) The action will be called when a successfully begins a locomotion event. /// /// /// /// startLocomotion has been deprecated. Use instead. /// [Obsolete("startLocomotion has been deprecated in XRI 3.0.0. Use beginLocomotion instead. (UnityUpgradable) -> beginLocomotion", true)] #pragma warning disable 67 // Never invoked, kept for API Updater public event Action startLocomotion; #pragma warning restore 67 [Tooltip("(Deprecated) The Locomotion System that this locomotion provider communicates with for exclusive access to an XR Origin." + " If one is not provided, the behavior will attempt to locate one during its Awake call.")] [Obsolete("LocomotionSystem is deprecated in XRI 3.0.0 and will be removed in a future release. Use mediator instead.", false)] LocomotionSystem m_System; /// /// (Deprecated) The that this communicates with /// for exclusive access to an XR Origin. /// /// is deprecated. Use instead. [Obsolete("LocomotionSystem is deprecated in XRI 3.0.0 and will be removed in a future release. Use mediator instead.", false)] public LocomotionSystem system { get => m_System; set => m_System = value; } /// /// (Deprecated) The of this . /// /// is deprecated. Use instead. /// Note that cannot be set because it is determined by the . [Obsolete("locomotionPhase is deprecated in XRI 3.0.0 and will be removed in a future release. Use locomotionState instead.", false)] public LocomotionPhase locomotionPhase { get; protected set; } #pragma warning disable 0067 // Suppress event never used warning /// /// (Deprecated) Unity calls the action when a successfully begins a locomotion event. /// /// is deprecated. Use instead. [Obsolete("beginLocomotion is deprecated in XRI 3.0.0 and will be removed in a future release. Use locomotionStarted instead.", false)] public event Action beginLocomotion; /// /// (Deprecated) Unity calls the action when a successfully ends a locomotion event. /// /// is deprecated. Use instead. [Obsolete("endLocomotion is deprecated in XRI 3.0.0 and will be removed in a future release. Use locomotionEnded instead.", false)] public event Action endLocomotion; #pragma warning restore 0067 /// /// (Deprecated) Checks if locomotion can begin. /// /// Returns if locomotion can start. Otherwise, returns . /// is deprecated. Instead, query to check /// if locomotion can start. [Obsolete("CanBeginLocomotion is deprecated in XRI 3.0.0 and will be removed in a future release. Instead, query isLocomotionActive to check if locomotion can start.", false)] protected bool CanBeginLocomotion() { if (m_System == null) return false; return !m_System.busy; } /// /// (Deprecated) Invokes begin locomotion events. /// /// Returns if successful. Otherwise, returns . /// is deprecated. Instead, call when /// locomotion start input occurs. [Obsolete("BeginLocomotion is deprecated in XRI 3.0.0 and will be removed in a future release. Instead, call TryPrepareLocomotion when locomotion start input occurs.", false)] protected bool BeginLocomotion() { if (m_System == null) return false; var success = m_System.RequestExclusiveOperation(this) == RequestResult.Success; if (success) beginLocomotion?.Invoke(m_System); return success; } /// /// (Deprecated) Invokes end locomotion events. /// /// Returns if successful. Otherwise, returns . /// is deprecated. Instead, call when /// locomotion end input has completed. [Obsolete("EndLocomotion is deprecated in XRI 3.0.0 and will be removed in a future release. Instead, call TryEndLocomotion when locomotion end input has completed.", false)] protected bool EndLocomotion() { if (m_System == null) return false; var success = m_System.FinishExclusiveOperation(this) == RequestResult.Success; if (success) endLocomotion?.Invoke(m_System); return success; } } }