OpenXRActionMap
Stored OpenXR action-set and interaction-profile structure.
OpenXRActionMap stores set/profile resources rather than current controller values. A new instance is empty. Startup loads the map at xr/openxr/default_action_map; creating or saving a different resource does not rebuild an attached XR session.
This complete executed helper creates gameplay/select with two Simple Controller bindings and can save .rdata. It neither enables XR nor simulates a controller:
using Reckfell;
public static class SelectionActionMap
{
// Caller owns the map. This builds resources; it does not start an XR session.
public static OpenXRActionMap Create()
{
var map = new OpenXRActionMap();
using var set = new OpenXRActionSet
{
ResourceName = "gameplay", LocalizedName = "Gameplay", Priority = 0
};
using var select = new OpenXRAction
{
ResourceName = "select", LocalizedName = "Select",
ActionType = OpenXRAction.ActionTypeEnum.Bool,
ToplevelPaths = ["/user/hand/left", "/user/hand/right"]
};
set.AddAction(select);
map.AddActionSet(set);
using var profile = new OpenXRInteractionProfile
{
InteractionProfilePath = "/interaction_profiles/khr/simple_controller"
};
using var left = new OpenXRIPBinding
{
Action = select, BindingPath = "/user/hand/left/input/select/click"
};
using var right = new OpenXRIPBinding
{
Action = select, BindingPath = "/user/hand/right/input/select/click"
};
using var bindings = new Reckfell.Collections.Array { left, right };
profile.Bindings = bindings;
map.AddInteractionProfile(profile);
return map;
}
public static Error Save(string path = "asset://openxr_action_map.rdata")
{
using var map = Create();
return ResourceSaver.Save(map, path);
}
}ActionSets and InteractionProfiles return shared Arrays. Self-assigning such a list clears it because the setter clears the existing container first. Duplicate() the container before replacement. GetActionSets().Clear() also edits the map, without Changed. Prefer Add/Remove methods for ordinary edits. SetActionSets itself emits no Changed. A container copy does not copy resources inside it.
AddActionSet deduplicates one resource identity, not distinct resources with matching names. FindActionSet uses ResourceName; FindInteractionProfile uses the full profile path. A profile belongs to one map and transfers when added elsewhere. CreateDefaultActionSets appends rather than resets: repeated calls create another reckfell set.
Structure, signals, arrays, profile transfer, defaults and saving with independent reload were checked in the installed Windows runtime. OpenXR remained disabled: input, headset profile acceptance, haptics and XR sessions were not tested. See the action-map guide for connection steps.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
OpenXRActionMapConstructor
public OpenXRActionMap();Creates an empty map without sets or profiles. Creates no default actions, XR session or file automatically.
Properties2
ActionSetsProperty
public Reckfell.Collections.Array ActionSets { get; set; }Action-set resource list. The getter returns a shared Array, not an independent copy: Clear() edits the map without Changed. The setter clears the current list, then adds valid sets without repeated resource identities; it emits no Changed and does not check ResourceName uniqueness. Assigning its own getter array clears the list. Duplicate() the container before replacement; prefer AddActionSet/RemoveActionSet for ordinary edits.
InteractionProfilesProperty
public Reckfell.Collections.Array InteractionProfiles { get; set; }Interaction-profile resource list. The getter returns a shared Array. The setter clears previous ownership links, then adds profiles through AddInteractionProfile; multiple Changed notifications are possible. Self-assignment of the shared array clears the list: use a separate container, such as Duplicate(), for replacement. A profile belongs to one map; moving it removes it from the previous map. These are binding resources, not connected-controller reports.
Methods15
AddActionSetvoid
public void AddActionSet(OpenXRActionSet actionSet);Adds an existing non-null set resource and emits Changed. Repeating the same resource is ignored without a signal. Distinct resources with identical ResourceName are not considered the same set; validate names separately. A set resource can be stored in multiple maps.
| Name | Type | Default |
|---|---|---|
actionSet | OpenXRActionSet | — |
actionSetExisting non-null set resource; operations use resource identity rather than matching names.
AddInteractionProfilevoid
public void AddInteractionProfile(OpenXRInteractionProfile interactionProfile);Adds a non-null profile and emits Changed. Repeating the same resource does nothing. If owned by another map, the profile is removed there and transferred here. Prepares resource data; does not register a new profile in a running runtime.
| Name | Type | Default |
|---|---|---|
interactionProfile | OpenXRInteractionProfile | — |
interactionProfileExisting non-null profile resource; adding may transfer it from a previous map.
CreateDefaultActionSetsvoid
public void CreateDefaultActionSets();Adds the standard reckfell set and default profiles/actions. Does not clear the map: repeated calls create another set with the same name. Use on a new empty map, not as reset. Saves no file and attaches no sets to an XR session.
FindActionSetOpenXRActionSet
public OpenXRActionSet FindActionSet(string name);Returns the first set with the exact ResourceName, or null. Case-sensitive; does not use LocalizedName. Check the result before accessing the set.
| Name | Type | Default |
|---|---|---|
name | string | — |
nameExact ResourceName of the desired set, not LocalizedName.
OpenXRActionSetFirst set with the exact ResourceName, or null.
FindInteractionProfileOpenXRInteractionProfile
public OpenXRInteractionProfile FindInteractionProfile(string name);Returns the first profile with the exact InteractionProfilePath, or null. Despite parameter name being name, it expects the full profile path, not ResourceName or a label.
| Name | Type | Default |
|---|---|---|
name | string | — |
nameComplete InteractionProfilePath, for example /interaction_profiles/khr/simple_controller.
OpenXRInteractionProfileFirst profile with the exact InteractionProfilePath, or null.
GetActionSetOpenXRActionSet
public OpenXRActionSet GetActionSet(int idx);Reads an existing set resource at index 0…GetActionSetCount()-1. References the same resource; editing its properties affects other users. Check bounds before calling.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex from 0 inclusive to the corresponding Count exclusive. Check the count before calling.
OpenXRActionSetExisting set resource at a valid index; not a copy.
GetActionSetCountint
public int GetActionSetCount();Number of set resources in this map. Not the count of active sets or sets attached to an XR session.
intMap-resource set count, initially 0.
GetActionSetsReckfell.Collections.Array
public Reckfell.Collections.Array GetActionSets();Action-set resource list. The getter returns a shared Array, not an independent copy: Clear() edits the map without Changed. The setter clears the current list, then adds valid sets without repeated resource identities; it emits no Changed and does not check ResourceName uniqueness. Assigning its own getter array clears the list. Duplicate() the container before replacement; prefer AddActionSet/RemoveActionSet for ordinary edits.
Reckfell.Collections.ArrayShared map Array; do not clear or assign it back without a separate container copy.
GetInteractionProfileOpenXRInteractionProfile
public OpenXRInteractionProfile GetInteractionProfile(int idx);Reads the profile resource at index 0…GetInteractionProfileCount()-1. Returns the same resource, not an independent copy; check bounds first.
| Name | Type | Default |
|---|---|---|
idx | int | — |
idxIndex from 0 inclusive to the corresponding Count exclusive. Check the count before calling.
OpenXRInteractionProfileExisting profile resource at a valid index; not a copy.
GetInteractionProfileCountint
public int GetInteractionProfileCount();Number of profiles in the map resource. Not a count of controllers, headsets or profiles supported by a connected runtime.
intProfile-resource count, initially 0.
GetInteractionProfilesReckfell.Collections.Array
public Reckfell.Collections.Array GetInteractionProfiles();Interaction-profile resource list. The getter returns a shared Array. The setter clears previous ownership links, then adds profiles through AddInteractionProfile; multiple Changed notifications are possible. Self-assignment of the shared array clears the list: use a separate container, such as Duplicate(), for replacement. A profile belongs to one map; moving it removes it from the previous map. These are binding resources, not connected-controller reports.
Reckfell.Collections.ArrayShared profile Array; directly editing the container changes the map resource.
RemoveActionSetvoid
public void RemoveActionSet(OpenXRActionSet actionSet);Removes the supplied resource from this map if present and emits Changed. Does not search by name, destroy external references or disable an attached runtime set.
| Name | Type | Default |
|---|---|---|
actionSet | OpenXRActionSet | — |
actionSetExisting non-null set resource; operations use resource identity rather than matching names.
RemoveInteractionProfilevoid
public void RemoveInteractionProfile(OpenXRInteractionProfile interactionProfile);Removes an existing profile resource from this map, clears its map ownership and emits Changed. Does nothing when absent. Does not rebuild an attached session’s bindings.
| Name | Type | Default |
|---|---|---|
interactionProfile | OpenXRInteractionProfile | — |
interactionProfileExisting non-null profile resource; adding may transfer it from a previous map.
SetActionSetsvoid
public void SetActionSets(Reckfell.Collections.Array actionSets);Action-set resource list. The getter returns a shared Array, not an independent copy: Clear() edits the map without Changed. The setter clears the current list, then adds valid sets without repeated resource identities; it emits no Changed and does not check ResourceName uniqueness. Assigning its own getter array clears the list. Duplicate() the container before replacement; prefer AddActionSet/RemoveActionSet for ordinary edits.
| Name | Type | Default |
|---|---|---|
actionSets | Reckfell.Collections.Array | — |
actionSetsSeparate Array of OpenXRActionSet resources. When starting from this map’s getter, Duplicate() the container first; self-assignment loses the list.
SetInteractionProfilesvoid
public void SetInteractionProfiles(Reckfell.Collections.Array interactionProfiles);Interaction-profile resource list. The getter returns a shared Array. The setter clears previous ownership links, then adds profiles through AddInteractionProfile; multiple Changed notifications are possible. Self-assignment of the shared array clears the list: use a separate container, such as Duplicate(), for replacement. A profile belongs to one map; moving it removes it from the previous map. These are binding resources, not connected-controller reports.
| Name | Type | Default |
|---|---|---|
interactionProfiles | Reckfell.Collections.Array | — |
interactionProfilesSeparate Array of non-null OpenXRInteractionProfile resources. Do not pass this map’s shared getter array without Duplicate().