예제 #1
0
 //Register the existing pads, the pads registered will be checked if their IDs are correct
 void RegisterExistingPads()
 {
     if (cameraRig != null)
     {
         controllerManager = cameraRig.transform.GetComponent <SteamVR_ControllerManager>();
         controllerManager.Refresh();
         controllersGameObject.Clear();
         devices.Clear();
         controllersGameObject.Add(controllerManager.left);
         controllersGameObject.Add(controllerManager.right);
         foreach (GameObject o in controllerManager.objects)
         {
             if (!controllersGameObject.Contains(o))
             {
                 controllersGameObject.Add(o);
             }
         }
     }
     else
     {
         Debug.LogWarning("Missing [Camera_Rig] !");
     }
 }
 //Register the existing pads, the pads registered will be checked if their IDs are correct
 void RegisterExistingPads()
 {
     if (cameraRig != null)
     {
         controllerManager = cameraRig.transform.GetComponent <SteamVR_ControllerManager>();
     }
     if (controllerManager == null)
     {
         return;
     }
     controllerManager.Refresh();
     controllersGameObject.Clear();
     devices.Clear();
     controllersGameObject.Add(controllerManager.left);
     controllersGameObject.Add(controllerManager.right);
     foreach (GameObject o in controllerManager.objects)
     {
         if (!controllersGameObject.Contains(o))
         {
             controllersGameObject.Add(o);
         }
     }
 }