private static void UpdateActionSetsArray() { List <VRActiveActionSet_t> activeActionSetsList = new List <VRActiveActionSet_t>(); SteamVR_Input_Sources[] sources = SteamVR_Input_Source.GetAllSources(); for (int actionSetIndex = 0; actionSetIndex < SteamVR_Input.actionSets.Length; actionSetIndex++) { SteamVR_ActionSet set = SteamVR_Input.actionSets[actionSetIndex]; for (int sourceIndex = 0; sourceIndex < sources.Length; sourceIndex++) { SteamVR_Input_Sources source = sources[sourceIndex]; if (set.ReadRawSetActive(source)) { VRActiveActionSet_t activeSet = new VRActiveActionSet_t(); activeSet.ulActionSet = set.handle; activeSet.nPriority = set.ReadRawSetPriority(source); //TODO: Action set priority //activeSet.nPriority = priorityToUse; activeSet.ulRestrictedToDevice = SteamVR_Input_Source.GetHandle(source); int insertionIndex = 0; for (insertionIndex = 0; insertionIndex < activeActionSetsList.Count; insertionIndex++) { if (activeActionSetsList[insertionIndex].nPriority > activeSet.nPriority) { break; } } activeActionSetsList.Insert(insertionIndex, activeSet); } } } changed = false; rawActiveActionSetArray = activeActionSetsList.ToArray(); if (Application.isEditor || updateDebugTextInBuilds) { UpdateDebugText(); } }