Ejemplo n.º 1
0
    private void StopCharging()
    {
        if (!isCharging)
        {
            return;
        }

        isCharging             = false;
        rigidBody.isKinematic  = false;
        rigidBody.velocity     = Vector3.zero;
        accelAmount            = chargeAmount;
        carController.CanSteer = true;
        carController.WheelCollidersFriction(true);
        cooldownTimer   = chargeCooldown * chargeAmount;
        stunImmuneTimer = 0.1f;

        float longChargeBonus = Mathf.Clamp(bonusChargeCurve.Evaluate(normalisedTimeCharged), 0.0f, 999.0f);

        carController.ApplyForwardImpulse(releaseImpulseAmount * (chargeAmount + longChargeBonus));

        ChargeAmount = 0.0f;

        GameObject.Find("Split Screen Manager").GetComponent <SplitScreenManager>().AddStroke(playerNumber);
    }