Corgi Engine  v8.8
MoreMountains.CorgiEngine.CharacterAutoMovement Class Reference

This ability will make your character move automatically, without having to touch the left or right inputs More...

Inheritance diagram for MoreMountains.CorgiEngine.CharacterAutoMovement:
MoreMountains.CorgiEngine.CharacterAbility MoreMountains.CorgiEngine.CorgiMonoBehaviour

Public Types

enum  InitialDirections { InitialDirections.Left, InitialDirections.Right, InitialDirections.None }
 the possible directions the character can start moving in More...
 

Public Member Functions

override void ProcessAbility ()
 On process ability we do nothing More...
 
override void LateProcessAbility ()
 On late process, we reset our driven input More...
 
virtual void PauseMovement ()
 Forces a pause in the movement, that can then be resumed More...
 
virtual void ResumeMovement ()
 Resumes movement More...
 
virtual void SetDrivenInput (float newDrivenInput)
 A method you can call to force a new input when in NoHorizontalInput mode More...
 
virtual void ChangeDirection ()
 Changes direction (left to right, right to left) More...
 
virtual void ForceDirection (float newDirection)
 Forces a direction (-1 left, 1 right) More...
 
virtual void ToggleRun ()
 Changes the run state (walk > run, run > walk) More...
 
virtual void ForceRun (bool status)
 Forces run (true) or walk (false) More...
 
- Public Member Functions inherited from MoreMountains.CorgiEngine.CharacterAbility
virtual string HelpBoxText ()
 This method is only used to display a helpbox text at the beginning of the ability's inspector. 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 UpdateAnimator ()
 Override this to send parameters to the character's animator. This is called once per cycle, by the Character class, after Early, normal and Late process(). 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

bool AutoSetup = true
 if this is true, will set other abilities in the appropriate configuration on initialization automatically More...
 
InitialDirections InitialDirection = InitialDirections.Right
 the initial direction the character should start moving towards More...
 
bool RunningOnStart = false
 if this is true, the character More...
 
bool NoHorizontalInput = false
 if this is true, input won't be read More...
 
float InitialInput = 1f
 if NoHorizontalInput is true, the initial value to apply to input More...
 
bool ChangeDirectionOnWalljump = true
 if this is true, doing a walljump will also cause a direction change More...
 
bool ChangeDirectionOnWallCollision = false
 if this is true, the character will change direction when colliding with a wall More...
 
bool ChangeDirectionOnWallCollisionOnlyIfGrounded = false
 if this is true, the character will change direction when colliding with a wall, but only if grounded - requires ChangeDirectionOnWallCollision to be true More...
 
bool ChangeDirectionOnFallingDown = false
 if this is true, the character will change direction when falling down, at the start of the fall More...
 
bool ToggleRunButton
 Test button for ToggleRun. More...
 
bool ChangeDirectionButton
 Test button for ChangeDirection. More...
 
bool PauseMovementButton
 Test button for ChangeDirection. More...
 
bool ResumeMovementButton
 Test button for ChangeDirection. 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 init we grab our components and set them if needed, set our initial direction and run state More...
 
override void HandleInput ()
 Forces a current direction and passes it to the CharacterHorizontalMovement ability More...
 
virtual void TestChangeDirectionOnWallCollision ()
 Checks if we should change direction if colliding with a wall More...
 
virtual void TestChangeDirectionOnFallingDown ()
 Checks if we should be changing direction if falling down More...
 
virtual void OnWallJump ()
 When the Character walljumps, we change direction if needed More...
 
- Protected Member Functions inherited from MoreMountains.CorgiEngine.CharacterAbility
virtual void Start ()
 On Start(), we call the ability's intialization More...
 
virtual void InitializeAnimatorParameters ()
 Adds required animator parameters to the animator parameters list if they exist 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...
 

Protected Attributes

CharacterRun _characterRun
 
CharacterWalljump _characterWallJump
 
float _currentDirection = 1f
 
bool _running = false
 
float _directionBeforePause = 0f
 
float _drivenInput = 1f
 
CharacterStates.MovementStates _movementStateLastFrame
 
- Protected Attributes inherited from MoreMountains.CorgiEngine.CharacterAbility
Character _character
 
Transform _characterTransform
 
Health _health
 
CharacterHorizontalMovement _characterHorizontalMovement
 
CorgiController _controller
 
InputManager _inputManager
 
CameraController _sceneCamera
 
Animator _animator
 
CharacterStates _state
 
SpriteRenderer _spriteRenderer
 
MMStateMachine< CharacterStates.MovementStates_movement
 
MMStateMachine< CharacterStates.CharacterConditions_condition
 
bool _abilityInitialized = false
 
CharacterGravity _characterGravity
 
float _verticalInput
 
float _horizontalInput
 
bool _startFeedbackIsPlaying = false
 
List< CharacterHandleWeapon_handleWeaponList
 

Additional Inherited Members

- Properties inherited from MoreMountains.CorgiEngine.CharacterAbility
virtual bool AbilityAuthorized [get]
 
virtual bool AbilityInitialized [get]
 true if the ability has already been initialized More...
 

Detailed Description

This ability will make your character move automatically, without having to touch the left or right inputs

Member Enumeration Documentation

◆ InitialDirections

the possible directions the character can start moving in

Enumerator
Left 
Right 
None 

Member Function Documentation

◆ ChangeDirection()

virtual void MoreMountains.CorgiEngine.CharacterAutoMovement.ChangeDirection ( )
virtual

Changes direction (left to right, right to left)

◆ ForceDirection()

virtual void MoreMountains.CorgiEngine.CharacterAutoMovement.ForceDirection ( float  newDirection)
virtual

Forces a direction (-1 left, 1 right)

Parameters
newDirection

◆ ForceRun()

virtual void MoreMountains.CorgiEngine.CharacterAutoMovement.ForceRun ( bool  status)
virtual

Forces run (true) or walk (false)

Parameters
status

◆ HandleInput()

override void MoreMountains.CorgiEngine.CharacterAutoMovement.HandleInput ( )
protectedvirtual

Forces a current direction and passes it to the CharacterHorizontalMovement ability

Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.

◆ Initialization()

override void MoreMountains.CorgiEngine.CharacterAutoMovement.Initialization ( )
protectedvirtual

On init we grab our components and set them if needed, set our initial direction and run state

Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.

◆ LateProcessAbility()

override void MoreMountains.CorgiEngine.CharacterAutoMovement.LateProcessAbility ( )
virtual

On late process, we reset our driven input

Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.

◆ OnWallJump()

virtual void MoreMountains.CorgiEngine.CharacterAutoMovement.OnWallJump ( )
protectedvirtual

When the Character walljumps, we change direction if needed

◆ PauseMovement()

virtual void MoreMountains.CorgiEngine.CharacterAutoMovement.PauseMovement ( )
virtual

Forces a pause in the movement, that can then be resumed

◆ ProcessAbility()

override void MoreMountains.CorgiEngine.CharacterAutoMovement.ProcessAbility ( )
virtual

On process ability we do nothing

Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.

◆ ResumeMovement()

virtual void MoreMountains.CorgiEngine.CharacterAutoMovement.ResumeMovement ( )
virtual

Resumes movement

◆ SetDrivenInput()

virtual void MoreMountains.CorgiEngine.CharacterAutoMovement.SetDrivenInput ( float  newDrivenInput)
virtual

A method you can call to force a new input when in NoHorizontalInput mode

Parameters
newDrivenInput

◆ TestChangeDirectionOnFallingDown()

virtual void MoreMountains.CorgiEngine.CharacterAutoMovement.TestChangeDirectionOnFallingDown ( )
protectedvirtual

Checks if we should be changing direction if falling down

◆ TestChangeDirectionOnWallCollision()

virtual void MoreMountains.CorgiEngine.CharacterAutoMovement.TestChangeDirectionOnWallCollision ( )
protectedvirtual

Checks if we should change direction if colliding with a wall

◆ ToggleRun()

virtual void MoreMountains.CorgiEngine.CharacterAutoMovement.ToggleRun ( )
virtual

Changes the run state (walk > run, run > walk)

Member Data Documentation

◆ _characterRun

CharacterRun MoreMountains.CorgiEngine.CharacterAutoMovement._characterRun
protected

◆ _characterWallJump

CharacterWalljump MoreMountains.CorgiEngine.CharacterAutoMovement._characterWallJump
protected

◆ _currentDirection

float MoreMountains.CorgiEngine.CharacterAutoMovement._currentDirection = 1f
protected

◆ _directionBeforePause

float MoreMountains.CorgiEngine.CharacterAutoMovement._directionBeforePause = 0f
protected

◆ _drivenInput

float MoreMountains.CorgiEngine.CharacterAutoMovement._drivenInput = 1f
protected

◆ _movementStateLastFrame

CharacterStates.MovementStates MoreMountains.CorgiEngine.CharacterAutoMovement._movementStateLastFrame
protected

◆ _running

bool MoreMountains.CorgiEngine.CharacterAutoMovement._running = false
protected

◆ AutoSetup

bool MoreMountains.CorgiEngine.CharacterAutoMovement.AutoSetup = true

if this is true, will set other abilities in the appropriate configuration on initialization automatically

◆ ChangeDirectionButton

bool MoreMountains.CorgiEngine.CharacterAutoMovement.ChangeDirectionButton

Test button for ChangeDirection.

◆ ChangeDirectionOnFallingDown

bool MoreMountains.CorgiEngine.CharacterAutoMovement.ChangeDirectionOnFallingDown = false

if this is true, the character will change direction when falling down, at the start of the fall

◆ ChangeDirectionOnWallCollision

bool MoreMountains.CorgiEngine.CharacterAutoMovement.ChangeDirectionOnWallCollision = false

if this is true, the character will change direction when colliding with a wall

◆ ChangeDirectionOnWallCollisionOnlyIfGrounded

bool MoreMountains.CorgiEngine.CharacterAutoMovement.ChangeDirectionOnWallCollisionOnlyIfGrounded = false

if this is true, the character will change direction when colliding with a wall, but only if grounded - requires ChangeDirectionOnWallCollision to be true

◆ ChangeDirectionOnWalljump

bool MoreMountains.CorgiEngine.CharacterAutoMovement.ChangeDirectionOnWalljump = true

if this is true, doing a walljump will also cause a direction change

◆ InitialDirection

InitialDirections MoreMountains.CorgiEngine.CharacterAutoMovement.InitialDirection = InitialDirections.Right

the initial direction the character should start moving towards

◆ InitialInput

float MoreMountains.CorgiEngine.CharacterAutoMovement.InitialInput = 1f

if NoHorizontalInput is true, the initial value to apply to input

◆ NoHorizontalInput

bool MoreMountains.CorgiEngine.CharacterAutoMovement.NoHorizontalInput = false

if this is true, input won't be read

◆ PauseMovementButton

bool MoreMountains.CorgiEngine.CharacterAutoMovement.PauseMovementButton

Test button for ChangeDirection.

◆ ResumeMovementButton

bool MoreMountains.CorgiEngine.CharacterAutoMovement.ResumeMovementButton

Test button for ChangeDirection.

◆ RunningOnStart

bool MoreMountains.CorgiEngine.CharacterAutoMovement.RunningOnStart = false

if this is true, the character

◆ ToggleRunButton

bool MoreMountains.CorgiEngine.CharacterAutoMovement.ToggleRunButton

Test button for ToggleRun.


The documentation for this class was generated from the following file: