Exemplo n.º 1
0
    private void FixedUpdate()
    {
        Vector3 forces = Vector3.zero;

        if (Drifting && aft != null && aft.Burning)
        {
            ShipPhysicsStats.ClampShipVelocity(rb, physicsStats, CruiseState.Off);
            ShipPhysicsStats.HandleDrifting(rb, physicsStats, false);
            forces = CalcAfterburnerForces();
        }

        else if (Drifting)
        {
            ShipPhysicsStats.HandleDrifting(rb, physicsStats, true);
        }

        else if (!Drifting)
        {
            ShipPhysicsStats.HandleDrifting(rb, physicsStats, false);
            forces = CalcStrafeForces() + CalcThrottleForces() + CalcAfterburnerForces();
        }

        if (forces != Vector3.zero)
        {
            rb.AddForce(forces);
        }
    }
Exemplo n.º 2
0
    private void HandleDriftingChange(bool drifting)
    {
        if (cruiseEngine != null && drifting)
        {
            cruiseEngine.StopAnyCruise();
        }

        ShipPhysicsStats.HandleDrifting(rb, engine.physicsStats, drifting);
    }