Corgi Engine
v9.0
|
Add this class to a character and it'll be able to jump Animator parameters : Jumping (bool), DoubleJumping (bool), HitTheGround (bool) More...
Public Types | |
enum | JumpBehavior { JumpBehavior.CanJumpOnGround, JumpBehavior.CanJumpOnGroundAndFromLadders, JumpBehavior.CanJumpAnywhere, JumpBehavior.CantJump, JumpBehavior.CanJumpAnywhereAnyNumberOfTimes } |
the possible jump restrictions More... | |
Public Member Functions | |
override string | HelpBoxText () |
This method is only used to display a helpbox text at the beginning of the ability's inspector. More... | |
override void | ProcessAbility () |
Every frame we perform a number of checks related to jump More... | |
virtual void | JumpStart () |
Causes the character to start jumping. More... | |
virtual void | SetCanJumpStop (bool status) |
Use this method, from any class, to prevent the current jump from being proportional (releasing won't cancel the jump/current momentum) More... | |
virtual bool | JumpDownFromOneWayPlatform () |
Handles jumping down from a one way platform. More... | |
virtual void | JumpStop () |
Causes the character to stop jumping. More... | |
virtual void | ResetNumberOfJumps () |
Resets the number of jumps. More... | |
virtual void | SetJumpFlags () |
Resets jump flags More... | |
virtual void | SetNumberOfJumpsLeft (int newNumberOfJumps) |
Sets the number of jumps left. More... | |
virtual void | ResetJumpButtonReleased () |
Resets the jump button released flag. More... | |
override void | UpdateAnimator () |
At the end of each cycle, sends Jumping states to the Character's animator More... | |
override void | ResetAbility () |
Resets parameters in anticipation for the Character's respawn. More... | |
Public Member Functions inherited from MoreMountains.CorgiEngine.CharacterAbility | |
virtual void | SetInputManager (InputManager inputManager) |
Sets a new input manager for this ability to get input from More... | |
virtual void | BindAnimator () |
Binds the animator from the character and initializes the animator parameters More... | |
virtual void | ResetInput () |
Resets all input for this ability. Can be overridden for ability specific directives More... | |
virtual void | EarlyProcessAbility () |
The first of the 3 passes you can have in your ability. Think of it as EarlyUpdate() if it existed More... | |
virtual void | LateProcessAbility () |
The last of the 3 passes you can have in your ability. Think of it as LateUpdate() More... | |
virtual void | PermitAbility (bool abilityPermitted) |
Changes the status of the ability's permission More... | |
virtual void | Flip () |
Override this to specify what should happen in this ability when the character flips More... | |
virtual void | PlayAbilityStartFeedbacks () |
Plays the ability start sound effect More... | |
virtual void | StopStartFeedbacks () |
Stops the ability used sound effect More... | |
virtual void | PlayAbilityStopFeedbacks () |
Plays the ability stop sound effect More... | |
virtual void | RegisterAnimatorParameter (string parameterName, AnimatorControllerParameterType parameterType, out int parameter) |
Registers a new animator parameter to the list More... | |
Public Attributes | |
int | NumberOfJumps = 2 |
the maximum number of jumps allowed (0 : no jump, 1 : normal jump, 2 : double jump, etc...) More... | |
float | JumpHeight = 3.025f |
defines how high the character can jump More... | |
JumpBehavior | JumpRestrictions = JumpBehavior.CanJumpAnywhere |
basic rules for jumps : where can the player jump ? More... | |
bool | ResetCameraOffsetOnJump = false |
if this is true, camera offset will be reset on jump More... | |
bool | CanJumpDownOneWayPlatforms = true |
if this is true, this character can jump down one way platforms by doing down + jump More... | |
bool | FixedAerialJumpCount = false |
deducts an additional jump if the sequence begins in the air. This keeps aerial jump count consistent regardless of whether the first jump began in the air or on the ground. More... | |
bool | JumpIsProportionalToThePressTime = true |
if true, the jump duration/height will be proportional to the duration of the button's press More... | |
float | JumpMinimumAirTime = 0.1f |
the minimum time in the air allowed when jumping - this is used for pressure controlled jumps More... | |
float | JumpReleaseForceFactor = 2f |
the amount by which we'll modify the current speed when the jump button gets released More... | |
float | CoyoteTime = 0f |
a timeframe during which, after leaving the ground, the character can still trigger a jump More... | |
float | InputBufferDuration = 0f |
if the character lands, and the jump button's been pressed during that InputBufferDuration, a new jump will be triggered More... | |
float | OneWayPlatformsJumpCollisionOffDuration = 0.3f |
duration (in seconds) we need to disable collisions when jumping down a 1 way platform More... | |
float | MovingPlatformsJumpCollisionOffDuration = 0.05f |
duration (in seconds) we need to disable collisions when jumping off a moving platform More... | |
MMFeedbacks | AirJumpFeedbacks |
the MMFeedbacks to play when jumping in the air More... | |
MMFeedbacks | DoubleJumpFeedbacks |
the MMFeedbacks to play when double jumping More... | |
int | NumberOfJumpsLeft |
the number of jumps left to the character More... | |
Public Attributes inherited from MoreMountains.CorgiEngine.CharacterAbility | |
MMFeedbacks | AbilityStartFeedbacks |
the feedbacks to play when the ability starts More... | |
MMFeedbacks | AbilityStopFeedbacks |
the feedbacks to play when the ability stops More... | |
bool | AbilityPermitted = true |
if true, this ability can perform as usual, if not, it'll be ignored. You can use this to unlock abilities over time for example More... | |
CharacterStates.MovementStates[] | BlockingMovementStates |
an array containing all the blocking movement states. If the Character is in one of these states and tries to trigger this ability, it won't be permitted. Useful to prevent this ability from being used while Idle or Swimming, for example. More... | |
CharacterStates.CharacterConditions[] | BlockingConditionStates |
an array containing all the blocking condition states. If the Character is in one of these states and tries to trigger this ability, it won't be permitted. Useful to prevent this ability from being used while dead, for example. More... | |
Weapon.WeaponStates[] | BlockingWeaponStates |
an array containing all the blocking weapon states. If one of the character's weapons is in one of these states and yet the character tries to trigger this ability, it won't be permitted. Useful to prevent this ability from being used while attacking, for example. More... | |
Protected Member Functions | |
override void | Initialization () |
On Start() we reset our number of jumps More... | |
virtual void | ResetInitialNumberOfJumps () |
Stores the current NumberOfJumps More... | |
override void | HandleInput () |
At the beginning of each cycle we check if we've just pressed or released the jump button More... | |
virtual void | HandlePreventedJump () |
Checks if the character is still grounded after a jump, potentially prevented by reset forces by another ability / weapon More... | |
virtual bool | EvaluateJumpTimeWindow () |
Determines if whether or not a Character is still in its Jump Window (the delay during which, after falling off a cliff, a jump is still possible without requiring multiple jumps) More... | |
virtual bool | EvaluateJumpConditions () |
Evaluates the jump conditions to determine whether or not a jump can occur More... | |
virtual void | JumpFromMovingPlatform () |
Handles jumping from a moving platform. More... | |
virtual void | UpdateController () |
Updates the controller state based on our current jumping state More... | |
override void | InitializeAnimatorParameters () |
Adds required animator parameters to the animator parameters list if they exist More... | |
Protected Member Functions inherited from MoreMountains.CorgiEngine.CharacterAbility | |
virtual void | Start () |
On Start(), we call the ability's intialization More... | |
virtual void | InternalHandleInput () |
Internal method to check if an input manager is present or not More... | |
virtual void | OnRespawn () |
Override this to describe what should happen to this ability when the character respawns More... | |
virtual void | OnDeath () |
Override this to describe what should happen to this ability when the character respawns More... | |
virtual void | OnHit () |
Override this to describe what should happen to this ability when the character takes a hit More... | |
virtual void | OnEnable () |
On enable, we bind our respawn delegate More... | |
virtual void | OnDisable () |
On disable, we unbind our respawn delegate More... | |
Static Protected Attributes | |
const string | _jumpingAnimationParameterName = "Jumping" |
const string | _doubleJumpingAnimationParameterName = "DoubleJumping" |
const string | _hitTheGroundAnimationParameterName = "HitTheGround" |
const string | _numberOfJumpsLeftParameterName = "NumberOfJumpsLeft" |
Properties | |
bool | JumpHappenedThisFrame [get, set] |
whether or not the jump happened this frame More... | |
bool | CanJumpStop [get, set] |
whether or not the jump can be stopped More... | |
virtual bool | JumpAuthorized [get] |
Evaluates the jump restrictions. More... | |
Properties inherited from MoreMountains.CorgiEngine.CharacterAbility | |
virtual bool | AbilityAuthorized [get] |
virtual bool | AbilityInitialized [get] |
true if the ability has already been initialized More... | |
Add this class to a character and it'll be able to jump Animator parameters : Jumping (bool), DoubleJumping (bool), HitTheGround (bool)
|
protectedvirtual |
Evaluates the jump conditions to determine whether or not a jump can occur
true
, if jump conditions was evaluated, false
otherwise.
|
protectedvirtual |
Determines if whether or not a Character is still in its Jump Window (the delay during which, after falling off a cliff, a jump is still possible without requiring multiple jumps)
true
, if jump time window was evaluated, false
otherwise.
|
protectedvirtual |
At the beginning of each cycle we check if we've just pressed or released the jump button
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protectedvirtual |
Checks if the character is still grounded after a jump, potentially prevented by reset forces by another ability / weapon
|
virtual |
This method is only used to display a helpbox text at the beginning of the ability's inspector.
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protectedvirtual |
On Start() we reset our number of jumps
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protectedvirtual |
Adds required animator parameters to the animator parameters list if they exist
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
virtual |
Handles jumping down from a one way platform.
|
protectedvirtual |
Handles jumping from a moving platform.
|
virtual |
Causes the character to start jumping.
|
virtual |
Causes the character to stop jumping.
|
virtual |
Every frame we perform a number of checks related to jump
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
virtual |
Resets parameters in anticipation for the Character's respawn.
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protectedvirtual |
Stores the current NumberOfJumps
|
virtual |
Resets the jump button released flag.
|
virtual |
Resets the number of jumps.
|
virtual |
Use this method, from any class, to prevent the current jump from being proportional (releasing won't cancel the jump/current momentum)
status |
|
virtual |
Resets jump flags
|
virtual |
Sets the number of jumps left.
newNumberOfJumps | New number of jumps. |
|
virtual |
At the end of each cycle, sends Jumping states to the Character's animator
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protectedvirtual |
Updates the controller state based on our current jumping state
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
MMFeedbacks MoreMountains.CorgiEngine.CharacterJump.AirJumpFeedbacks |
the MMFeedbacks to play when jumping in the air
bool MoreMountains.CorgiEngine.CharacterJump.CanJumpDownOneWayPlatforms = true |
if this is true, this character can jump down one way platforms by doing down + jump
float MoreMountains.CorgiEngine.CharacterJump.CoyoteTime = 0f |
a timeframe during which, after leaving the ground, the character can still trigger a jump
MMFeedbacks MoreMountains.CorgiEngine.CharacterJump.DoubleJumpFeedbacks |
the MMFeedbacks to play when double jumping
bool MoreMountains.CorgiEngine.CharacterJump.FixedAerialJumpCount = false |
deducts an additional jump if the sequence begins in the air. This keeps aerial jump count consistent regardless of whether the first jump began in the air or on the ground.
float MoreMountains.CorgiEngine.CharacterJump.InputBufferDuration = 0f |
if the character lands, and the jump button's been pressed during that InputBufferDuration, a new jump will be triggered
float MoreMountains.CorgiEngine.CharacterJump.JumpHeight = 3.025f |
defines how high the character can jump
bool MoreMountains.CorgiEngine.CharacterJump.JumpIsProportionalToThePressTime = true |
if true, the jump duration/height will be proportional to the duration of the button's press
float MoreMountains.CorgiEngine.CharacterJump.JumpMinimumAirTime = 0.1f |
the minimum time in the air allowed when jumping - this is used for pressure controlled jumps
float MoreMountains.CorgiEngine.CharacterJump.JumpReleaseForceFactor = 2f |
the amount by which we'll modify the current speed when the jump button gets released
JumpBehavior MoreMountains.CorgiEngine.CharacterJump.JumpRestrictions = JumpBehavior.CanJumpAnywhere |
basic rules for jumps : where can the player jump ?
float MoreMountains.CorgiEngine.CharacterJump.MovingPlatformsJumpCollisionOffDuration = 0.05f |
duration (in seconds) we need to disable collisions when jumping off a moving platform
int MoreMountains.CorgiEngine.CharacterJump.NumberOfJumps = 2 |
the maximum number of jumps allowed (0 : no jump, 1 : normal jump, 2 : double jump, etc...)
int MoreMountains.CorgiEngine.CharacterJump.NumberOfJumpsLeft |
the number of jumps left to the character
float MoreMountains.CorgiEngine.CharacterJump.OneWayPlatformsJumpCollisionOffDuration = 0.3f |
duration (in seconds) we need to disable collisions when jumping down a 1 way platform
bool MoreMountains.CorgiEngine.CharacterJump.ResetCameraOffsetOnJump = false |
if this is true, camera offset will be reset on jump
|
getset |
whether or not the jump can be stopped
|
get |
Evaluates the jump restrictions.
|
getset |
whether or not the jump happened this frame