Esempio n. 1
0
 public CarState HandleInput(Car car)
 {
     if (Input.GetAxisRaw("Move") != 0 && car.physics.canMove)
     {
         DrivingMoveState newState = new DrivingMoveState();
         newState.Init(car);
         return(newState);
     }
     else
     {
         return(this);
     }
 }
 public CarState HandleInput(Car car)
 {
     mag = (dir * Input.GetAxis("HorizontalA") / 2) + 0.5f;
     if (boostEvaluate(car, Car.driftBoostTimeB * timeWeight, 2.333333f, ref playedB, car.driftBoomB) || boostEvaluate(car, Car.driftBoostTimeA * timeWeight, 1.666666f, ref playedA, car.driftBoomA))
     {
         DrivingMoveState newState = new DrivingMoveState();
         return(newState.Init(car));
     }
     else if (!Input.GetButton("Drift") || !CarStateUtility.carIsMoving(car, true))
     {
         DrivingMoveState newState = new DrivingMoveState();
         return(newState.Init(car));
     }
     return(this);
 }