Skip to content

Commit

Permalink
fix(Caching): get specific ControllerManager for left/right controller
Browse files Browse the repository at this point in the history
  • Loading branch information
pargee committed Oct 15, 2016
1 parent e79f4fc commit d817dc4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Assets/VRTK/SDK/SteamVR/SDK_SteamVR.cs
Expand Up @@ -470,7 +470,14 @@ private SteamVR_ControllerManager GetControllerManager()
{
if (cachedControllerManager == null)
{
cachedControllerManager = FindObjectOfType<SteamVR_ControllerManager>();
SteamVR_ControllerManager[] controllerManagers = FindObjectsOfType<SteamVR_ControllerManager>();
foreach (SteamVR_ControllerManager cm in controllerManagers)
{
if (cm.left && cm.right)
{
cachedControllerManager = cm;
}
}
}
return cachedControllerManager;
}
Expand Down

0 comments on commit d817dc4

Please sign in to comment.