Class VRAvatar
A full, concrete implementation of IVRAvatar.
Inheritance
Implements
Inherited Members
Namespace: Liminal.SDK.VR.Avatars
Assembly: Liminal.SDK.dll
Syntax
[DisallowMultipleComponent]
[AddComponentMenu("VR/Avatar/Avatar Body")]
public class VRAvatar : MonoBehaviour, IVRAvatar
Properties
| Improve this Doc View SourceActive
Gets the current active IVRAvatar.
Declaration
public static IVRAvatar Active { get; }
Property Value
Type | Description |
---|---|
IVRAvatar |
Auxiliaries
Gets the container for auxiliary systems.
Declaration
public Transform Auxiliaries { get; }
Property Value
Type | Description |
---|---|
UnityEngine.Transform |
Extensions
Gets the list of all extension assigned to the avatar.
Declaration
public IList<IVRAvatarExtension> Extensions { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<IVRAvatarExtension> |
Hands
Gets a list of all hand limbs.
Declaration
public IList<IVRAvatarHand> Hands { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<IVRAvatarHand> |
Head
Gets the Head limb.
Declaration
public IVRAvatarHead Head { get; }
Property Value
Type | Description |
---|---|
IVRAvatarHead |
IsActive
Indicates if the avatar is currently active.
Declaration
public bool IsActive { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Limbs
Gets a list of all limbs.
Declaration
public IList<IVRAvatarLimb> Limbs { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IList<IVRAvatarLimb> |
LookForward
Gets the forward looking direction vector for the avatar. This is a shortcut to the head's active eye camera forward.
Declaration
public Vector3 LookForward { get; }
Property Value
Type | Description |
---|---|
UnityEngine.Vector3 |
LookRotation
Gets the looking rotation for the avatar. This is a shortcut to the head's active eye camera rotation.
Declaration
public Quaternion LookRotation { get; }
Property Value
Type | Description |
---|---|
UnityEngine.Quaternion |
PrimaryHand
Gets the primary hand limb.
Declaration
public IVRAvatarHand PrimaryHand { get; }
Property Value
Type | Description |
---|---|
IVRAvatarHand |
ScreenFader
Gets the screen fader for the avatar.
Declaration
public IScreenFader ScreenFader { get; }
Property Value
Type | Description |
---|---|
IScreenFader |
SecondaryHand
Gets the secondary hand limb.
Declaration
public IVRAvatarHand SecondaryHand { get; }
Property Value
Type | Description |
---|---|
IVRAvatarHand |
Transform
Gets the avatar's transform.
Declaration
public Transform Transform { get; }
Property Value
Type | Description |
---|---|
UnityEngine.Transform |
Methods
| Improve this Doc View SourceGetExtension(Type)
Get the first extension of the specified type, or null if no extension exists of this type.
Declaration
public IVRAvatarExtension GetExtension(Type type)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type of the extension. |
Returns
Type | Description |
---|---|
IVRAvatarExtension | The extension of the specified type, or null if no extension exists of this type. |
GetExtension<TExtension>()
Get the first extension of the specified type, or null if no extension exists of this type.
Declaration
public TExtension GetExtension<TExtension>()
where TExtension : IVRAvatarExtension
Returns
Type | Description |
---|---|
TExtension | The extension of the specified type, or null if no extension exists of this type. |
Type Parameters
Name | Description |
---|---|
TExtension | The extension of the specified type. |
GetExtensions(Type, IList<IVRAvatarExtension>)
Gets all extensions of the specified type and places them into the supplied list and returns the number of objects that were added to the list. The list is cleared before any objects are added.
Declaration
public int GetExtensions(Type type, IList<IVRAvatarExtension> list)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | The type of the extensions to add. |
System.Collections.Generic.IList<IVRAvatarExtension> | list | The list to add the extensions to. |
Returns
Type | Description |
---|---|
System.Int32 | The number of objects that were added to the list. |
GetExtensions<TExtension>(IList<TExtension>)
Gets all extensions of the specified type and places them into the supplied list and returns the number of objects that were added to the list. The list is cleared before any objects are added.
Declaration
public int GetExtensions<TExtension>(IList<TExtension> list)
where TExtension : IVRAvatarExtension
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<TExtension> | list | The list to add the extensions to. |
Returns
Type | Description |
---|---|
System.Int32 | The number of objects that were added to the list. |
Type Parameters
Name | Description |
---|---|
TExtension | The type of the extensions to add. |
GetLimb(VRAvatarLimbAlias)
Gets the limb for the specified VRAvatarLimbAlias alias.
Declaration
public IVRAvatarLimb GetLimb(VRAvatarLimbAlias alias)
Parameters
Type | Name | Description |
---|---|---|
VRAvatarLimbAlias | alias | The limb alias. |
Returns
Type | Description |
---|---|
IVRAvatarLimb | The IVRAvatarLimb for the specified alias, or null if no limb is available for the supplied alias value. |
GetLimb(VRAvatarLimbType)
Gets the first IVRAvatarLimb of the specified type attached to the avatar.
Declaration
public IVRAvatarLimb GetLimb(VRAvatarLimbType type)
Parameters
Type | Name | Description |
---|---|---|
VRAvatarLimbType | type | The VRAvatarLimbType of the limb to retrieve. |
Returns
Type | Description |
---|---|
IVRAvatarLimb | The first IVRAvatarLimb of the specified type. |
GetLimb(IVRDeviceComponent)
Gets the IVRAvatarLimb assigned to the specified IVRDeviceComponent.
Declaration
public IVRAvatarLimb GetLimb(IVRDeviceComponent deviceComponent)
Parameters
Type | Name | Description |
---|---|---|
IVRDeviceComponent | deviceComponent | The VR device component of the limb to retrieve. |
Returns
Type | Description |
---|---|
IVRAvatarLimb | The IVRAvatarLimb assigned to the specified IVRDeviceComponent. |
HasLimb(VRAvatarLimbType)
Indicates if the avatar has a IVRAvatarLimb of the specified VRAvatarLimbType type.
Declaration
public bool HasLimb(VRAvatarLimbType type)
Parameters
Type | Name | Description |
---|---|---|
VRAvatarLimbType | type | The VRAvatarLimbType of the limb to search for. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean indicating if the avatar has a IVRAvatarLimb of the specified VRAvatarLimbType type. |
InitializeExtensions()
Initializes all avatar extensions.
Declaration
public void InitializeExtensions()
SetActive(Boolean)
Sets the active state for the avatar.
Declaration
public void SetActive(bool activeState)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | activeState | The active state to set. |
SetHandsActiveState(Boolean)
Sets the active state for the hand limbs.
Declaration
public void SetHandsActiveState(bool activeState)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | activeState | The active state for the hand limbs. |
SetLimbActiveState(VRAvatarLimbType, Boolean)
Sets the active state for all limbs of the specified VRAvatarLimbType.
Declaration
public void SetLimbActiveState(VRAvatarLimbType limbType, bool activeState)
Parameters
Type | Name | Description |
---|---|---|
VRAvatarLimbType | limbType | The VRAvatarLimbType. |
System.Boolean | activeState | The active state for all limbs of the supplied type. |
Events
| Improve this Doc View SourceAvatarChanged
Raised when the active avatar has changed.
Declaration
public static event VRAvatarEventHandler AvatarChanged
Event Type
Type | Description |
---|---|
VRAvatarEventHandler |