/// <summary> /// This function informs the LocomotionSystem that Exclusive Access to the XR Rig is no longer required. /// </summary> /// <param name="provider">The LocomtionProvider that is relinquishing access.</param> /// <returns>A RequestResult that reflects the status of the request</returns> public RequestResult FinishExclusiveOperation(LocomotionProvider provider) { if (provider == null || m_CurrentExclusiveProvider == null) { return(RequestResult.Error); } if (m_CurrentExclusiveProvider == provider) { ResetExclusivity(); return(RequestResult.Success); } else { return(RequestResult.Error); } }
/// <summary> /// The RequestExclusiveOperation function will attempt to "lock" access to the XR Rig for the Locomotion Provider passed /// </summary> /// <param name="provider">The locomotion provider that is requesting access</param> /// <returns>A RequestResult that reflects the status of the request</returns> public RequestResult RequestExclusiveOperation(LocomotionProvider provider) { if (provider == null) { return(RequestResult.Error); } if (m_CurrentExclusiveProvider == null) { m_CurrentExclusiveProvider = provider; m_TimeMadeExclusive = Time.time; return(RequestResult.Success); } if (m_CurrentExclusiveProvider != provider) { return(RequestResult.Busy); } return(RequestResult.Error); }
internal void ResetExclusivity() { m_CurrentExclusiveProvider = null; m_TimeMadeExclusive = 0.0f; }