private IEnumerator GhostRacerAction(int action, float time)
    {
        yield return(new WaitForSeconds(time));

        if (ghostRacer == null)
        {
            yield return(null);
        }

        switch (action)
        {
        case GhostDataBundle.EventType.ThrottlePress:
            ghostRacer.StepOnGas();
            break;

        case GhostDataBundle.EventType.ThrottleRelease:
            ghostRacer.ReleaseGas();
            break;

        case GhostDataBundle.EventType.GearUp:
            ghostRacer.ShiftUp();
            break;

        case GhostDataBundle.EventType.GearDown:
            ghostRacer.ShiftDown();
            break;

        default:
            break;
        }

        yield return(null);
    }
Ejemplo n.º 2
0
 void FixedUpdate()
 {
     if (_Car.IsLaunched)
     {
         if (_Car.CurrnetRPM >= _Car.MaxRPM - 10)
         {
             _Car.ShiftUp();
         }
     }
     else
     {
         _Car.StepOnGas();
     }
 }
 private void GearUp()
 {
     _player.ShiftUp();
 }