OpenXRAction
Name, value type and device paths of one OpenXR action.
OpenXRAction describes an action such as select or move, not a current press. ResourceName is the internal key; LocalizedName the label. A new resource has ActionType=Float, an empty label and empty ToplevelPaths. Configure it, add it to a set and reference it from separate profile BindingPath entries.
ToplevelPaths stores device paths such as /user/hand/left and /user/hand/right, not button paths. One logical command for both hands uses one action resource and two bindings. C# string[] data is copied here: editing the input array or getter result does not change the resource. Assign edited data back to update it. The ReadOnlySpan overload also copies data into the native resource.
Current named SDK types are Bool, Float, Vector2 and Pose. Native code and the editor have Haptic, but the installed SDK has no named ActionTypeEnum.Haptic. Do not use a nonexistent member or numeric substitution.
All three setters emit Changed even for repeated values. This is a resource-edit signal, not an input event. Editing the resource does not rebuild an attached XR-session action. Adding one instance to a second set transfers it out of the first.
Defaults, setters, notifications, both path overloads, copies and map persistence with bindings were checked in the current runtime. Device input, pose tracking, haptics and runtime path validation were not tested. Complete example and diagnostics: action map.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
OpenXRActionConstructor
public OpenXRAction();Creates a Float action with empty LocalizedName and ToplevelPaths. Set ResourceName, label, required type and devices, then add it to a set.
Properties3
ActionTypeProperty
public OpenXRAction.ActionTypeEnum ActionType { get; set; }Action value type, initially Float. Named values in the current C# SDK are Bool, Float, Vector2 and Pose. Native code and the editor also have Haptic, but this SDK exposes no named Haptic member. The setter emits Changed even on repetition and does not change an existing runtime action’s type. Do not replace missing API with a numeric cast.
LocalizedNameProperty
public string LocalizedName { get; set; }Human-readable label, initially empty. ResourceName separately stores the internal key. The setter stores the string and emits Changed even on repetition; it does not fully validate OpenXR requirements. Supply a nonempty unique label in the appropriate namespace before session attachment. Editing the resource does not rename an already created runtime action/set.
ToplevelPathsProperty
public string[] ToplevelPaths { get; set; }Top-level device paths for the action, initially empty; for example /user/hand/left and /user/hand/right. Not full button paths or left_hand/right_hand tracker names. C# arrays are copied on assignment and readback; ReadOnlySpan also copies data into native storage. The setter emits Changed even on repetition. Validate paths before attachment; saving a resource does not establish runtime support.
Methods7
GetActionTypeOpenXRAction.ActionTypeEnum
public OpenXRAction.ActionTypeEnum GetActionType();Current resource type, initially Float. Describes the action value, not controller type or current input.
OpenXRAction.ActionTypeEnumCurrent action type; a new resource returns Float.
GetLocalizedNamestring
public string GetLocalizedName();Stored human-readable action label. Query input using the internal ResourceName, not this string.
stringStored label, initially empty; not ResourceName.
GetToplevelPathsstring[]
public string[] GetToplevelPaths();Independent C# copy of stored top-level device paths. Editing the result does not change the resource: assign edited data through ToplevelPaths/SetToplevelPaths.
string[]Independent string[] of top-level device paths; empty for a new resource.
SetActionTypevoid
public void SetActionType(OpenXRAction.ActionTypeEnum actionType);Action value type, initially Float. Named values in the current C# SDK are Bool, Float, Vector2 and Pose. Native code and the editor also have Haptic, but this SDK exposes no named Haptic member. The setter emits Changed even on repetition and does not change an existing runtime action’s type. Do not replace missing API with a numeric cast.
| Name | Type | Default |
|---|---|---|
actionType | OpenXRAction.ActionTypeEnum | — |
actionTypeA named SDK type: Bool, Float, Vector2 or Pose. Does not alter an existing runtime action.
SetLocalizedNamevoid
public void SetLocalizedName(string localizedName);Human-readable label, initially empty. ResourceName separately stores the internal key. The setter stores the string and emits Changed even on repetition; it does not fully validate OpenXR requirements. Supply a nonempty unique label in the appropriate namespace before session attachment. Editing the resource does not rename an already created runtime action/set.
| Name | Type | Default |
|---|---|---|
localizedName | string | — |
localizedNameNonempty human-readable label for the prepared map. Neither an internal name nor automatic translation; supply text in the intended language.
SetToplevelPaths2 overloads
public void SetToplevelPaths(ReadOnlySpan<string> toplevelPaths);Top-level device paths for the action, initially empty; for example /user/hand/left and /user/hand/right. Not full button paths or left_hand/right_hand tracker names. C# arrays are copied on assignment and readback; ReadOnlySpan also copies data into native storage. The setter emits Changed even on repetition. Validate paths before attachment; saving a resource does not establish runtime support.
| Name | Type | Default |
|---|---|---|
toplevelPaths | ReadOnlySpan<string> | — |
toplevelPathsDevice paths such as /user/hand/left and /user/hand/right. Not complete button paths; data is copied into the resource.
public void SetToplevelPaths(string[] toplevelPaths);Top-level device paths for the action, initially empty; for example /user/hand/left and /user/hand/right. Not full button paths or left_hand/right_hand tracker names. C# arrays are copied on assignment and readback; ReadOnlySpan also copies data into native storage. The setter emits Changed even on repetition. Validate paths before attachment; saving a resource does not establish runtime support.
| Name | Type | Default |
|---|---|---|
toplevelPaths | string[] | — |
toplevelPathsDevice paths such as /user/hand/left and /user/hand/right. Not complete button paths; data is copied into the resource.
OpenXRAction.ActionTypeEnum
| Value | Description |
|---|---|
Bool = 0 | This action provides a boolean value. |
Float = 1 | This action provides a float value between |
Pose = 3 | |
Vector2 = 2 | This action provides a |