Exemple #1
0
 public void UpdateInputType()
 {
     if (gameState.controllerType == 0)
     {
         inputType = ControllerType.keyboard;
     }
     else if (gameState.controllerType == 1)
     {
         inputType = ControllerType.xboxController;
     }
     else if (gameState.controllerType == 2)
     {
         inputType = ControllerType.ps4Controller;
     }
     else if (gameState.controllerType == 3)
     {
         inputType = ControllerType.steeringWheel;
     }
     // Bindes the correct gear type dependent of the gameState.
     if (gameState.gearType == 0)
     {
         shiftType = gearShiftType.automatic;
     }
     else if (gameState.gearType == 1)
     {
         shiftType = gearShiftType.hShift;
     }
     else if (gameState.gearType == 2)
     {
         shiftType = gearShiftType.paddleShift;
     }
 }
Exemple #2
0
 void Start()
 {
     // Store main car script and the gameState script.
     carScript = GetComponent <Car>();
     gameState = GameObject.Find("GameState").GetComponent <GameStateScript>();
     // Bindes the correct input type dependent on the gameState.
     if (gameState.controllerType == 0)
     {
         inputType = ControllerType.keyboard;
     }
     else if (gameState.controllerType == 1)
     {
         inputType = ControllerType.xboxController;
     }
     else if (gameState.controllerType == 2)
     {
         inputType = ControllerType.ps4Controller;
     }
     else if (gameState.controllerType == 3)
     {
         inputType = ControllerType.steeringWheel;
     }
     // Bindes the correct gear type dependent of the gameState.
     if (gameState.gearType == 0)
     {
         shiftType = gearShiftType.automatic;
     }
     else if (gameState.gearType == 1)
     {
         shiftType = gearShiftType.hShift;
     }
     else if (gameState.gearType == 2)
     {
         shiftType = gearShiftType.paddleShift;
     }
 }