[Tooltip("General multiplier for gravity (affects jump and freefall)")]publicfloatgravityMultiplier=5f;
[Tooltip("The initial upwards push when pressing jump. This is injected into verticalMovement, and gradually cancelled by gravity")]publicfloatinitialJumpForce=10f;
[Tooltip("How long can the player hold the jump button")]publicfloatjumpInputDuration=.4f;
[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("Smoothing for rotating the character to their movement direction")]publicfloatturnSmoothTime=0.2f;
[Tooltip("General multiplier for gravity (affects jump and freefall)")]publicfloatgravityMultiplier=5f;
[Tooltip("The initial upwards push when pressing jump. This is injected into verticalMovement, and gradually cancelled by gravity")]publicfloatinitialJumpForce=10f;
[Tooltip("How long can the player hold the jump button")]publicfloatjumpInputDuration=.4f;
[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;
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
privatefloatjumpBeginTime=-Mathf.Infinity;//Time of the last jump
privatefloatverticalMovement=0f;//Represents how much a player will move vertically in a frame. Affected by gravity * gravityContributionMultiplier
privateVector3inputVector;//Initial input horizontal movement (y == 0f)
privateVector3movementVector;//Final movement vector
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
privatefloatjumpBeginTime=-Mathf.Infinity;//Time of the last jump
privatefloatturnSmoothSpeed;//Used by Mathf.SmoothDampAngle to smoothly rotate the character to their movement direction
privatefloatverticalMovement=0f;//Represents how much a player will move vertically in a frame. Affected by gravity * gravityContributionMultiplier
privateVector3inputVector;//Initial input horizontal movement (y == 0f)
privateVector3movementVector;//Final movement vector