Ejemplo n.º 1
0
 void ControlPawn()
 {
     if (m == Mode.ShootMode)
     {
         PV.RunValidation();
         //We'll need a VR Controller, We'll cross this bridge once we get to the rift
         if (GameMaster.getVRState() == VRState.InPawn)
         {
             //Set VR Camera Active
             //Set Player Cam inactive
         }
         else
         {
             float rx = 0f;
             float ry = 0f;
             if (Input.GetKey(KeyCode.W))
             {
                 rx -= .5f;
             }
             if (Input.GetKey(KeyCode.A))
             {
                 ry -= .5f;
             }
             if (Input.GetKey(KeyCode.S))
             {
                 rx += .5f;
             }
             if (Input.GetKey(KeyCode.D))
             {
                 ry += .5f;
             }
             SelectedPawn.RotateHead(rx, ry);
         }
     }
     else if (m == Mode.MoveMode)
     {
         float x = 0f;
         float z = 0f;
         //We need better solution than hardcoded #
         if (Input.GetKey(KeyCode.W))
         {
             x -= 5;
         }
         if (Input.GetKey(KeyCode.A))
         {
             z -= 5;
         }
         if (Input.GetKey(KeyCode.S))
         {
             x += 5;
         }
         if (Input.GetKey(KeyCode.D))
         {
             z += 5;
         }
         PV.RunValidation(x, z);
     }
 }