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

Add this component to a character and it'll be able to jetpack Animator parameters : Jetpacking (bool) More...

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

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...
 
virtual void JetpackStart ()
 Causes the character to start its jetpack. More...
 
virtual void JetpackStop ()
 Causes the character to stop its jetpack. More...
 
override void ProcessAbility ()
 Every frame, we check if our character is colliding with the ceiling. If that's the case we cap its vertical force More...
 
override void Flip ()
 Flips the jetpack's emitter horizontally More...
 
override void ResetAbility ()
 When the character dies we stop its jetpack More...
 
override void UpdateAnimator ()
 At the end of each cycle, we send our character's animator the current jetpacking status 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 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 MovingPlatformsJumpCollisionOffDuration =0.05f
 the duration (in seconds) during which we'll disable the collider when taking off jetpacking from a moving platform More...
 
ParticleSystem ParticleEmitter
 the jetpack associated to the character More...
 
float JetpackForce = 2.5f
 the force applied by the jetpack More...
 
bool JetpackUnlimited = false
 true if the character has unlimited fuel for its jetpack More...
 
float JetpackFuelDuration = 5f
 the maximum duration (in seconds) of the jetpack More...
 
float JetpackRefuelCooldown =1f
 the jetpack refuel cooldown, in seconds More...
 
float RefuelSpeed = 0.5f
 the speed at which the jetpack refuels More...
 
float MinimumFuelRequirement = 0.2f
 the minimum amount of fuel required in the tank to be able to jetpack again More...
 
AudioClip JetpackRefueledSfx
 The sound to play when the jetpack is refueled again. More...
 
float JetpackFuelDurationLeft = 0f
 the remaining jetpack fuel duration (in seconds) 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 grab our particle emitter if there's one, and setup our fuel reserves More...
 
override void HandleInput ()
 Every frame, we check input to see if we're pressing or releasing the jetpack button More...
 
virtual void TurnJetpackElementsOff ()
 Stops the jetpack sounds, particles and state More...
 
virtual void BurnFuel ()
 Consumes fuel if needed More...
 
virtual void Refuel ()
 Refuels the jetpack if needed More...
 
virtual void UpdateJetpackBar ()
 Updates the GUI jetpack bar. More...
 
virtual void PlayJetpackRefueledSfx ()
 Plays a sound when the jetpack is fully refueled 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...
 

Protected Attributes

bool _refueling = false
 
bool _jetpacking = true
 
Vector3 _initialPosition
 
AudioSource _jetpackUsedSound
 
WaitForSeconds _jetpackRefuelCooldownWFS
 
float _timer
 
float _jetpackStoppedAt
 
int _jetpackingAnimationParameter
 
- 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
 

Static Protected Attributes

const string _jetpackingAnimationParameterName = "Jetpacking"
 

Properties

virtual bool FuelLeft [get]
 returns true if this jetpack still has fuel left, false otherwise More...
 
- 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

Add this component to a character and it'll be able to jetpack Animator parameters : Jetpacking (bool)

Member Function Documentation

◆ BurnFuel()

virtual void MoreMountains.CorgiEngine.CharacterJetpack.BurnFuel ( )
protectedvirtual

Consumes fuel if needed

◆ Flip()

override void MoreMountains.CorgiEngine.CharacterJetpack.Flip ( )
virtual

Flips the jetpack's emitter horizontally

Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.

◆ HandleInput()

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

Every frame, we check input to see if we're pressing or releasing the jetpack button

Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.

◆ HelpBoxText()

override string MoreMountains.CorgiEngine.CharacterJetpack.HelpBoxText ( )
virtual

This method is only used to display a helpbox text at the beginning of the ability's inspector.

Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.

◆ Initialization()

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

On Start(), we grab our particle emitter if there's one, and setup our fuel reserves

Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.

◆ InitializeAnimatorParameters()

override void MoreMountains.CorgiEngine.CharacterJetpack.InitializeAnimatorParameters ( )
protectedvirtual

Adds required animator parameters to the animator parameters list if they exist

Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.

◆ JetpackStart()

virtual void MoreMountains.CorgiEngine.CharacterJetpack.JetpackStart ( )
virtual

Causes the character to start its jetpack.

◆ JetpackStop()

virtual void MoreMountains.CorgiEngine.CharacterJetpack.JetpackStop ( )
virtual

Causes the character to stop its jetpack.

◆ PlayJetpackRefueledSfx()

virtual void MoreMountains.CorgiEngine.CharacterJetpack.PlayJetpackRefueledSfx ( )
protectedvirtual

Plays a sound when the jetpack is fully refueled

◆ ProcessAbility()

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

Every frame, we check if our character is colliding with the ceiling. If that's the case we cap its vertical force

Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.

◆ Refuel()

virtual void MoreMountains.CorgiEngine.CharacterJetpack.Refuel ( )
protectedvirtual

Refuels the jetpack if needed

◆ ResetAbility()

override void MoreMountains.CorgiEngine.CharacterJetpack.ResetAbility ( )
virtual

When the character dies we stop its jetpack

Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.

◆ TurnJetpackElementsOff()

virtual void MoreMountains.CorgiEngine.CharacterJetpack.TurnJetpackElementsOff ( )
protectedvirtual

Stops the jetpack sounds, particles and state

◆ UpdateAnimator()

override void MoreMountains.CorgiEngine.CharacterJetpack.UpdateAnimator ( )
virtual

At the end of each cycle, we send our character's animator the current jetpacking status

Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.

◆ UpdateJetpackBar()

virtual void MoreMountains.CorgiEngine.CharacterJetpack.UpdateJetpackBar ( )
protectedvirtual

Updates the GUI jetpack bar.

Member Data Documentation

◆ _initialPosition

Vector3 MoreMountains.CorgiEngine.CharacterJetpack._initialPosition
protected

◆ _jetpacking

bool MoreMountains.CorgiEngine.CharacterJetpack._jetpacking = true
protected

◆ _jetpackingAnimationParameter

int MoreMountains.CorgiEngine.CharacterJetpack._jetpackingAnimationParameter
protected

◆ _jetpackingAnimationParameterName

const string MoreMountains.CorgiEngine.CharacterJetpack._jetpackingAnimationParameterName = "Jetpacking"
staticprotected

◆ _jetpackRefuelCooldownWFS

WaitForSeconds MoreMountains.CorgiEngine.CharacterJetpack._jetpackRefuelCooldownWFS
protected

◆ _jetpackStoppedAt

float MoreMountains.CorgiEngine.CharacterJetpack._jetpackStoppedAt
protected

◆ _jetpackUsedSound

AudioSource MoreMountains.CorgiEngine.CharacterJetpack._jetpackUsedSound
protected

◆ _refueling

bool MoreMountains.CorgiEngine.CharacterJetpack._refueling = false
protected

◆ _timer

float MoreMountains.CorgiEngine.CharacterJetpack._timer
protected

◆ JetpackForce

float MoreMountains.CorgiEngine.CharacterJetpack.JetpackForce = 2.5f

the force applied by the jetpack

◆ JetpackFuelDuration

float MoreMountains.CorgiEngine.CharacterJetpack.JetpackFuelDuration = 5f

the maximum duration (in seconds) of the jetpack

◆ JetpackFuelDurationLeft

float MoreMountains.CorgiEngine.CharacterJetpack.JetpackFuelDurationLeft = 0f

the remaining jetpack fuel duration (in seconds)

◆ JetpackRefuelCooldown

float MoreMountains.CorgiEngine.CharacterJetpack.JetpackRefuelCooldown =1f

the jetpack refuel cooldown, in seconds

◆ JetpackRefueledSfx

AudioClip MoreMountains.CorgiEngine.CharacterJetpack.JetpackRefueledSfx

The sound to play when the jetpack is refueled again.

◆ JetpackUnlimited

bool MoreMountains.CorgiEngine.CharacterJetpack.JetpackUnlimited = false

true if the character has unlimited fuel for its jetpack

◆ MinimumFuelRequirement

float MoreMountains.CorgiEngine.CharacterJetpack.MinimumFuelRequirement = 0.2f

the minimum amount of fuel required in the tank to be able to jetpack again

◆ MovingPlatformsJumpCollisionOffDuration

float MoreMountains.CorgiEngine.CharacterJetpack.MovingPlatformsJumpCollisionOffDuration =0.05f

the duration (in seconds) during which we'll disable the collider when taking off jetpacking from a moving platform

◆ ParticleEmitter

ParticleSystem MoreMountains.CorgiEngine.CharacterJetpack.ParticleEmitter

the jetpack associated to the character

◆ RefuelSpeed

float MoreMountains.CorgiEngine.CharacterJetpack.RefuelSpeed = 0.5f

the speed at which the jetpack refuels

Property Documentation

◆ FuelLeft

virtual bool MoreMountains.CorgiEngine.CharacterJetpack.FuelLeft
get

returns true if this jetpack still has fuel left, false otherwise


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