Class VRAvatarExtensions
A collection of useful extension methods for the VRAvatar system.
Inheritance
Inherited Members
Namespace: Liminal.SDK.VR.Avatars
Assembly: Liminal.SDK.dll
Syntax
public static class VRAvatarExtensions
Methods
| Improve this Doc View SourceCreateAuxiliaryObject(IVRAvatar, String, HideFlags)
Creates a GameObject and places it under the avatar's Auxiliary object.
Declaration
public static GameObject CreateAuxiliaryObject(this IVRAvatar avatar, string name, HideFlags hideFlags = HideFlags.None)
Parameters
Type | Name | Description |
---|---|---|
IVRAvatar | avatar | The avatar. |
System.String | name | The name of the GameObject to create. |
UnityEngine.HideFlags | hideFlags | Optional hide flags to set on the object. |
Returns
Type | Description |
---|---|
UnityEngine.GameObject | The newly created auxiliary GameObject. |
GetControllerVisual(IVRAvatar, VRPointerEventData)
Gets the VRControllerVisual for the limb that triggered a VR pointer event.
Declaration
public static VRControllerVisual GetControllerVisual(this IVRAvatar avatar, VRPointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
IVRAvatar | avatar | The avatar. |
VRPointerEventData | eventData | The pointer event data. |
Returns
Type | Description |
---|---|
VRControllerVisual | The VRControllerVisual for the limb that triggered the VR pointer event, or null if no controller is found. |
GetControllerVisual(IVRAvatar, VRInputDeviceHand)
Gets the VRControllerVisual for the IVRInputDevice assigned to the specified hand.
Declaration
public static VRControllerVisual GetControllerVisual(this IVRAvatar avatar, VRInputDeviceHand hand)
Parameters
Type | Name | Description |
---|---|---|
IVRAvatar | avatar | The avatar. |
VRInputDeviceHand | hand | The avatar hand. |
Returns
Type | Description |
---|---|
VRControllerVisual | The VRControllerVisual for the specified hand, or null if no controller is found. |
GetControllerVisual(IVRAvatar, PointerEventData)
Gets the VRControllerVisual for the limb that triggered a pointer event.
Declaration
public static VRControllerVisual GetControllerVisual(this IVRAvatar avatar, PointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
IVRAvatar | avatar | The avatar. |
UnityEngine.EventSystems.PointerEventData | eventData | The pointer event data. |
Returns
Type | Description |
---|---|
VRControllerVisual | The VRControllerVisual for the limb that triggered the pointer event, or null if no controller is found. |
GetControllerVisual(IVRAvatarLimb)
Gets the VRControllerVisual for the specified IVRAvatarLimb.
Declaration
public static VRControllerVisual GetControllerVisual(this IVRAvatarLimb limb)
Parameters
Type | Name | Description |
---|---|---|
IVRAvatarLimb | limb | The avatar limb. |
Returns
Type | Description |
---|---|
VRControllerVisual | The VRControllerVisual for the specified limb, or null if no controller is found. |
GetHand(IVRAvatar, VRPointerEventData)
Gets the IVRAvatarHand of the avatar that owns the IVRPointer that triggered the event.
Declaration
public static IVRAvatarHand GetHand(this IVRAvatar avatar, VRPointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
IVRAvatar | avatar | The avatar. |
VRPointerEventData | eventData | The event data. |
Returns
Type | Description |
---|---|
IVRAvatarHand | The IVRAvatarHand that owns the pointer that triggered the event. |
GetHand(IVRAvatar, VRInputDeviceHand)
Gets the IVRAvatarHand for the specified input device handedness.
Declaration
public static IVRAvatarHand GetHand(this IVRAvatar avatar, VRInputDeviceHand hand)
Parameters
Type | Name | Description |
---|---|---|
IVRAvatar | avatar | The avatar. |
VRInputDeviceHand | hand | The input device handedness. |
Returns
Type | Description |
---|---|
IVRAvatarHand | The IVRAvatarHand for the specified input device handedness |
GetHand(IVRAvatar, IVRDeviceComponent)
Gets the IVRAvatarHand assigned to the specified IVRDeviceComponent. If the limb assigned to the device component does not implement IVRAvatarHand, a null reference will be returned.
Declaration
public static IVRAvatarHand GetHand(this IVRAvatar avatar, IVRDeviceComponent deviceComponent)
Parameters
Type | Name | Description |
---|---|---|
IVRAvatar | avatar | The avatar. |
IVRDeviceComponent | deviceComponent | The VR device component of the limb to retrieve. |
Returns
Type | Description |
---|---|
IVRAvatarHand | The IVRAvatarHand assigned to the specified IVRDeviceComponent, or null if the assigned limb does not implement IVRAvatarHand. |
GetHand(IVRAvatar, PointerEventData)
Gets the IVRAvatarHand of the avatar that owns the IVRPointer that triggered the event.
Declaration
public static IVRAvatarHand GetHand(this IVRAvatar avatar, PointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
IVRAvatar | avatar | The avatar. |
UnityEngine.EventSystems.PointerEventData | eventData | The event data. |
Returns
Type | Description |
---|---|
IVRAvatarHand | The IVRAvatarHand that owns the pointer that triggered the event. |
GetLimb(IVRAvatar, VRPointerEventData)
Gets the IVRAvatarLimb of the avatar that owns the IVRPointer that triggered the event.
Declaration
public static IVRAvatarLimb GetLimb(this IVRAvatar avatar, VRPointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
IVRAvatar | avatar | The avatar. |
VRPointerEventData | eventData | The event data. |
Returns
Type | Description |
---|---|
IVRAvatarLimb | The IVRAvatarLimb that owns the pointer that triggered the event. |
GetLimb(IVRAvatar, PointerEventData)
Gets the IVRAvatarLimb of the avatar that owns the IVRPointer that triggered the event.
Declaration
public static IVRAvatarLimb GetLimb(this IVRAvatar avatar, PointerEventData eventData)
Parameters
Type | Name | Description |
---|---|---|
IVRAvatar | avatar | The avatar. |
UnityEngine.EventSystems.PointerEventData | eventData | The event data. |
Returns
Type | Description |
---|---|
IVRAvatarLimb | The IVRAvatarLimb that owns the pointer that triggered the event. |
InstantiateControllerVisual(IVRAvatarLimb)
Instantiates a VRControllerVisual for this limb.
Declaration
public static VRControllerVisual InstantiateControllerVisual(this IVRAvatarLimb limb)
Parameters
Type | Name | Description |
---|---|---|
IVRAvatarLimb | limb | The limb for the controller. |
Returns
Type | Description |
---|---|
VRControllerVisual | The newly instantiated controller visual for this limb, or null if no controller visual was able to be created. |