![]() |
Corgi Engine v9.3
|
Add this ability to a Character to have it handle horizontal movement (walk, and potentially run, crawl, etc) Animator parameters : Speed (float), Walking (bool) 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 () |
The second of the 3 passes you can have in your ability. Think of it as Update() More... | |
virtual void | SetAirControlDirection (float newInputValue) |
When using low (or null) air control, this method lets you externally set the direction air control should consider as the base value More... | |
virtual void | SetHorizontalMove (float value) |
Sets the horizontal move value. More... | |
virtual void | ResetHorizontalSpeed () |
A public method to reset the horizontal speed More... | |
virtual void | ResetMovementSpeedMultiplier () |
Resets the current movement multiplier to its initial value More... | |
virtual void | ApplyContextSpeedMultiplier (float movementMultiplier, float duration) |
Applies a movement multiplier for the specified duration More... | |
virtual void | SetContextSpeedMultiplier (float newMovementSpeedMultiplier) |
Stacks a new context speed multiplier More... | |
virtual void | ResetContextSpeedMultiplier () |
Revers the context speed multiplier to its previous value More... | |
override void | UpdateAnimator () |
Sends the current speed and the current value of the Walking state to the animator More... | |
![]() | |
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 | ResetAbility () |
Override this to reset this ability's parameters. It'll be automatically called when the character gets killed, in anticipation for its respawn. 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 | |
float | WalkSpeed = 6f |
the speed of the character when it's walking More... | |
bool | ResetHorizontalSpeedBtn |
press this debug button if you decide to change the WalkSpeed at runtime, to reset its cache and have it impact your character in real time More... | |
float | MovementSpeedMultiplier = 1f |
the multiplier to apply to the horizontal movement More... | |
float | AbilityMovementSpeedMultiplier = 1f |
the multiplier to apply to the horizontal movement, dedicated to abilities More... | |
float | PushSpeedMultiplier = 1f |
the multiplier to apply when pushing More... | |
float | StateSpeedMultiplier = 1f |
the multiplier that gets set and applied by CharacterSpeed More... | |
bool | FlipCharacterToFaceDirection = true |
if this is true, the character will automatically flip to face its movement direction More... | |
bool | ReadInput = true |
if this is true, will get input from an input source, otherwise you'll have to set it via SetHorizontalMove() More... | |
bool | InstantAcceleration = false |
if this is true, no acceleration will be applied to the movement, which will instantly be full speed (think Megaman movement). Attention : a character with instant acceleration won't be able to get knockbacked on the x axis as a regular character would, it's a tradeoff More... | |
float | InputThreshold = 0.1f |
the threshold after which input is considered (usually 0.1f to eliminate small joystick noise) More... | |
float | AirControl = 1f |
how much air control the player has More... | |
bool | AllowFlipInTheAir = true |
whether or not the player can flip in the air More... | |
bool | ActiveAfterDeath = false |
whether or not this ability should keep taking care of horizontal movement after death More... | |
MMFeedbacks | TouchTheGroundFeedback |
the MMFeedbacks to play when the character hits the ground More... | |
float | MinimumAirTimeBeforeFeedback = 0.2f |
the duration (in seconds) during which the character has to be airborne before a feedback can be played when touching the ground More... | |
bool | StopWalkingWhenCollidingWithAWall = false |
Whether or not the state should be reset to Idle when colliding laterally with a wall. More... | |
Stack< float > | ContextSpeedStack = new Stack<float>() |
![]() | |
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 Initialization, we set our movement speed to WalkSpeed. More... | |
override void | HandleInput () |
Called at the very start of the ability's cycle, and intended to be overridden, looks for input and calls methods if conditions are met More... | |
virtual void | HandleHorizontalMovement () |
Called at Update(), handles horizontal movement More... | |
virtual bool | DetectWalls (bool changeState) |
This method will return true if a wall is detected in front of the character, false otherwise More... | |
virtual void | CheckJustGotGrounded () |
Every frame, checks if we just hit the ground, and if yes, changes the state and triggers a particle effect More... | |
virtual void | StoreLastTimeGrounded () |
Computes and stores the last time we were grounded More... | |
virtual float | HandleFriction (float force) |
Handles surface friction. More... | |
virtual IEnumerator | ApplyContextSpeedMultiplierCo (float movementMultiplier, float duration) |
A coroutine used to apply a movement multiplier for a certain duration only More... | |
override void | InitializeAnimatorParameters () |
Adds required animator parameters to the animator parameters list if they exist More... | |
virtual void | OnRevive () |
When the character gets revived we reinit it again More... | |
override void | OnEnable () |
When the player respawns, we reinstate this agent. More... | |
override void | OnDisable () |
On disable, we stop listening for OnRevive events More... | |
![]() | |
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... | |
Protected Attributes | |
float | _horizontalMovement |
float | _lastGroundedHorizontalMovement |
float | _horizontalMovementForce |
float | _normalizedHorizontalSpeed |
float | _lastTimeGrounded = 0f |
float | _initialMovementSpeedMultiplier |
int | _speedAnimationParameter |
int | _walkingAnimationParameter |
int | _relativeSpeedAnimationParameter |
![]() | |
Character | _character |
Transform | _characterTransform |
Health | _health |
CharacterHorizontalMovement | _characterHorizontalMovement |
CorgiController | _controller |
InputManager | _inputManager |
CameraController | _sceneCamera |
Animator | _animator |
CharacterStates | _state |
MMStateMachine< CharacterStates.MovementStates > | _movement |
MMStateMachine< CharacterStates.CharacterConditions > | _condition |
bool | _abilityInitialized = false |
CharacterGravity | _characterGravity |
float | _verticalInput |
float | _horizontalInput |
bool | _startFeedbackIsPlaying = false |
List< CharacterHandleWeapon > | _handleWeaponList |
Static Protected Attributes | |
const string | _speedAnimationParameterName = "Speed" |
const string | _relativeSpeedAnimationParameterName = "xSpeedFacing" |
const string | _walkingAnimationParameterName = "Walking" |
Properties | |
float | MovementSpeed [getset] |
the current reference movement speed More... | |
virtual float | HorizontalMovementForce [get] |
the current horizontal movement force More... | |
virtual bool | MovementForbidden [getset] |
if this is true, movement will be forbidden (as well as flip) More... | |
float | ContextSpeedMultiplier [get] |
![]() | |
virtual bool | AbilityAuthorized [get] |
virtual bool | AbilityInitialized [get] |
true if the ability has already been initialized More... | |
Add this ability to a Character to have it handle horizontal movement (walk, and potentially run, crawl, etc) Animator parameters : Speed (float), Walking (bool)
|
virtual |
Applies a movement multiplier for the specified duration
movementMultiplier | |
duration |
|
protectedvirtual |
A coroutine used to apply a movement multiplier for a certain duration only
movementMultiplier | |
duration |
|
protectedvirtual |
Every frame, checks if we just hit the ground, and if yes, changes the state and triggers a particle effect
|
protectedvirtual |
This method will return true if a wall is detected in front of the character, false otherwise
changeState | Whether or not this method should change state to idle if a wall is found |
|
protectedvirtual |
Handles surface friction.
force | the force we want to apply friction to. |
|
protectedvirtual |
Called at Update(), handles horizontal movement
if we're dashing, we stop there
|
protectedvirtual |
Called at the very start of the ability's cycle, and intended to be overridden, looks for input and calls methods if conditions are met
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
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 Initialization, we set our movement speed to WalkSpeed.
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protectedvirtual |
Adds required animator parameters to the animator parameters list if they exist
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protectedvirtual |
On disable, we stop listening for OnRevive events
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protectedvirtual |
When the player respawns, we reinstate this agent.
checkpoint | Checkpoint. |
player | Player. |
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protectedvirtual |
When the character gets revived we reinit it again
|
virtual |
The second of the 3 passes you can have in your ability. Think of it as Update()
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
virtual |
Revers the context speed multiplier to its previous value
|
virtual |
A public method to reset the horizontal speed
|
virtual |
Resets the current movement multiplier to its initial value
|
virtual |
When using low (or null) air control, this method lets you externally set the direction air control should consider as the base value
newInputValue |
|
virtual |
Stacks a new context speed multiplier
newMovementSpeedMultiplier |
|
virtual |
Sets the horizontal move value.
value | Horizontal move value, between -1 and 1 - positive : will move to the right, negative : will move left |
|
protectedvirtual |
Computes and stores the last time we were grounded
|
virtual |
Sends the current speed and the current value of the Walking state to the animator
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
float MoreMountains.CorgiEngine.CharacterHorizontalMovement.AbilityMovementSpeedMultiplier = 1f |
the multiplier to apply to the horizontal movement, dedicated to abilities
bool MoreMountains.CorgiEngine.CharacterHorizontalMovement.ActiveAfterDeath = false |
whether or not this ability should keep taking care of horizontal movement after death
float MoreMountains.CorgiEngine.CharacterHorizontalMovement.AirControl = 1f |
how much air control the player has
bool MoreMountains.CorgiEngine.CharacterHorizontalMovement.AllowFlipInTheAir = true |
whether or not the player can flip in the air
Stack<float> MoreMountains.CorgiEngine.CharacterHorizontalMovement.ContextSpeedStack = new Stack<float>() |
bool MoreMountains.CorgiEngine.CharacterHorizontalMovement.FlipCharacterToFaceDirection = true |
if this is true, the character will automatically flip to face its movement direction
float MoreMountains.CorgiEngine.CharacterHorizontalMovement.InputThreshold = 0.1f |
the threshold after which input is considered (usually 0.1f to eliminate small joystick noise)
bool MoreMountains.CorgiEngine.CharacterHorizontalMovement.InstantAcceleration = false |
if this is true, no acceleration will be applied to the movement, which will instantly be full speed (think Megaman movement). Attention : a character with instant acceleration won't be able to get knockbacked on the x axis as a regular character would, it's a tradeoff
float MoreMountains.CorgiEngine.CharacterHorizontalMovement.MinimumAirTimeBeforeFeedback = 0.2f |
the duration (in seconds) during which the character has to be airborne before a feedback can be played when touching the ground
float MoreMountains.CorgiEngine.CharacterHorizontalMovement.MovementSpeedMultiplier = 1f |
the multiplier to apply to the horizontal movement
float MoreMountains.CorgiEngine.CharacterHorizontalMovement.PushSpeedMultiplier = 1f |
the multiplier to apply when pushing
bool MoreMountains.CorgiEngine.CharacterHorizontalMovement.ReadInput = true |
if this is true, will get input from an input source, otherwise you'll have to set it via SetHorizontalMove()
bool MoreMountains.CorgiEngine.CharacterHorizontalMovement.ResetHorizontalSpeedBtn |
press this debug button if you decide to change the WalkSpeed at runtime, to reset its cache and have it impact your character in real time
float MoreMountains.CorgiEngine.CharacterHorizontalMovement.StateSpeedMultiplier = 1f |
the multiplier that gets set and applied by CharacterSpeed
bool MoreMountains.CorgiEngine.CharacterHorizontalMovement.StopWalkingWhenCollidingWithAWall = false |
Whether or not the state should be reset to Idle when colliding laterally with a wall.
MMFeedbacks MoreMountains.CorgiEngine.CharacterHorizontalMovement.TouchTheGroundFeedback |
the MMFeedbacks to play when the character hits the ground
float MoreMountains.CorgiEngine.CharacterHorizontalMovement.WalkSpeed = 6f |
the speed of the character when it's walking
|
get |
|
get |
the current horizontal movement force
|
getset |
if this is true, movement will be forbidden (as well as flip)
|
getset |
the current reference movement speed