/// <summary> /// Sets the handedness of the primary user. If the handedness changes from current will trigger events registered via <see cref="UsesDeviceHandednessMethods.SubscribeToHandednessChanged"/>. /// </summary> /// <param name="user">The functionality user.</param> /// <param name="value">The desired handedness for the primary user.</param> public static void SetHandedness(this IUsesDeviceHandedness user, XRControllerHandedness value) { user.provider.handedness = value; }
/// <summary> /// Returns the current handedness set for this user. /// </summary> /// <param name="user">The functionality user.</param> /// <returns>The current handedness of the primary user.</returns> public static XRControllerHandedness GetHandedness(this IUsesDeviceHandedness user) { return(user.provider.handedness); }
/// <summary> /// Unsubscribes to handedness changes. If the callback was not subscribed, does nothing. /// </summary> /// <param name="user">The functionality user.</param> /// <param name="action">The method that was registered via <see cref="SubscribeToHandednessChanged"/>.</param> public static void UnsubscribeToHandednessChanged(this IUsesDeviceHandedness user, Action <XRControllerHandedness> action) { user.provider.handednessChanged -= action; }