[Tooltip("Represents how fast gravityContributionMultiplier will go back to 1f. The higher, the faster")]publicfloatgravityComebackMultiplier=15f;
[Tooltip("The maximum speed reached when falling (in units/frame)")]publicfloatmaxFallSpeed=50f;
[Tooltip("Each frame while jumping, gravity will be multiplied by this amount in an attempt to 'cancel it' (= jump higher)")]publicfloatgravityDivider=.6f;
[Tooltip("Adjust the friction of the slope")]publicfloatslideFriction=0.3f;
privatefloatgravityContributionMultiplier=0f;//The factor which determines how much gravity is affecting verticalMovement
privateboolisJumping=false;//If true, a jump is in effect and the player is holding the jump button
privatefloatcurrentSlope;
privateVector3hitNormal;// ground normal
privateboolshouldSlide;// Should player slide?
privateVector3inputVector;//Initial input horizontal movement (y == 0f)
privateVector3movementVector;//Final movement vector