Corgi Engine  v9.1
MoreMountains.CorgiEngine.Stompable Class Reference

Add this class to an enemy (or whatever you want), to be able to stomp on it More...

Inheritance diagram for MoreMountains.CorgiEngine.Stompable:
MoreMountains.CorgiEngine.CorgiMonoBehaviour

Public Types

enum  KnockbackStyles { KnockbackStyles.NoKnockback, KnockbackStyles.SetForce, KnockbackStyles.AddForce }
 the possible ways to add knockback : noKnockback, which won't do nothing, set force, or add force More...
 

Public Attributes

Vector2 KnockbackForce = new Vector2(0f,15f)
 The force the hit will apply to the stomper. More...
 
KnockbackStyles DamageCausedKnockbackType = KnockbackStyles.SetForce
 the type of knockback to apply when causing damage More...
 
int DamagePerStomp
 The amount of damage each stomp causes to the stomped enemy. More...
 
bool ResetNumberOfJumpsOnStomp = false
 if this is true, the character's number of jump will be reset when Stomping More...
 
float InvincibilityDuration = 0.5f
 the duration of the invincibility after a stomp More...
 
LayerMask PlayerMask = LayerManager.PlayerLayerMask
 The layer the player is on. More...
 
int NumberOfRays = 5
 The number of vertical rays cast to detect stomping. More...
 
float RaycastLength = 0.5f
 the length of the rays More...
 
float RaycastVerticalOffset = 0.01f
 the offset to apply to the ray's origin point vertically (0.01f should work in most situations but you might want to adapt that based on your objects' scale). More...
 
bool StomperMustBeAlive = true
 whether or not the stomper has to be alive to be able to stomp this character (set this to false and dead players can still cause damage to this Stompable by falling on it) More...
 

Protected Member Functions

virtual void Start ()
 On start, we get the various components More...
 
virtual void LateUpdate ()
 Each update, we cast rays above More...
 
virtual void CastRaysAbove ()
 Casts the rays above to detect stomping More...
 
virtual bool HitIsValid ()
 Returns true if the hit is coming from above More...
 
virtual void InitializeRay ()
 Initializes the ray origins More...
 
virtual void PerformStomp (CorgiController corgiController)
 Performs the stomp. More...
 

Protected Attributes

BoxCollider2D _boxCollider
 
CorgiController _controller
 
Health _health
 
CharacterJump _collidingCharacterJump
 
Vector2 _verticalRayCastStart
 
Vector2 _verticalRayCastEnd
 
RaycastHit2D[] _hitsStorage
 
int _hitConnectedIndex
 

Detailed Description

Add this class to an enemy (or whatever you want), to be able to stomp on it

Member Enumeration Documentation

◆ KnockbackStyles

the possible ways to add knockback : noKnockback, which won't do nothing, set force, or add force

Enumerator
NoKnockback 
SetForce 
AddForce 

Member Function Documentation

◆ CastRaysAbove()

virtual void MoreMountains.CorgiEngine.Stompable.CastRaysAbove ( )
protectedvirtual

Casts the rays above to detect stomping

◆ HitIsValid()

virtual bool MoreMountains.CorgiEngine.Stompable.HitIsValid ( )
protectedvirtual

Returns true if the hit is coming from above

Returns

◆ InitializeRay()

virtual void MoreMountains.CorgiEngine.Stompable.InitializeRay ( )
protectedvirtual

Initializes the ray origins

◆ LateUpdate()

virtual void MoreMountains.CorgiEngine.Stompable.LateUpdate ( )
protectedvirtual

Each update, we cast rays above

◆ PerformStomp()

virtual void MoreMountains.CorgiEngine.Stompable.PerformStomp ( CorgiController  corgiController)
protectedvirtual

Performs the stomp.

Parameters
corgiControllerCorgi controller.

◆ Start()

virtual void MoreMountains.CorgiEngine.Stompable.Start ( )
protectedvirtual

On start, we get the various components

Member Data Documentation

◆ _boxCollider

BoxCollider2D MoreMountains.CorgiEngine.Stompable._boxCollider
protected

◆ _collidingCharacterJump

CharacterJump MoreMountains.CorgiEngine.Stompable._collidingCharacterJump
protected

◆ _controller

CorgiController MoreMountains.CorgiEngine.Stompable._controller
protected

◆ _health

Health MoreMountains.CorgiEngine.Stompable._health
protected

◆ _hitConnectedIndex

int MoreMountains.CorgiEngine.Stompable._hitConnectedIndex
protected

◆ _hitsStorage

RaycastHit2D [] MoreMountains.CorgiEngine.Stompable._hitsStorage
protected

◆ _verticalRayCastEnd

Vector2 MoreMountains.CorgiEngine.Stompable._verticalRayCastEnd
protected

◆ _verticalRayCastStart

Vector2 MoreMountains.CorgiEngine.Stompable._verticalRayCastStart
protected

◆ DamageCausedKnockbackType

KnockbackStyles MoreMountains.CorgiEngine.Stompable.DamageCausedKnockbackType = KnockbackStyles.SetForce

the type of knockback to apply when causing damage

◆ DamagePerStomp

int MoreMountains.CorgiEngine.Stompable.DamagePerStomp

The amount of damage each stomp causes to the stomped enemy.

◆ InvincibilityDuration

float MoreMountains.CorgiEngine.Stompable.InvincibilityDuration = 0.5f

the duration of the invincibility after a stomp

◆ KnockbackForce

Vector2 MoreMountains.CorgiEngine.Stompable.KnockbackForce = new Vector2(0f,15f)

The force the hit will apply to the stomper.

◆ NumberOfRays

int MoreMountains.CorgiEngine.Stompable.NumberOfRays = 5

The number of vertical rays cast to detect stomping.

◆ PlayerMask

LayerMask MoreMountains.CorgiEngine.Stompable.PlayerMask = LayerManager.PlayerLayerMask

The layer the player is on.

◆ RaycastLength

float MoreMountains.CorgiEngine.Stompable.RaycastLength = 0.5f

the length of the rays

◆ RaycastVerticalOffset

float MoreMountains.CorgiEngine.Stompable.RaycastVerticalOffset = 0.01f

the offset to apply to the ray's origin point vertically (0.01f should work in most situations but you might want to adapt that based on your objects' scale).

◆ ResetNumberOfJumpsOnStomp

bool MoreMountains.CorgiEngine.Stompable.ResetNumberOfJumpsOnStomp = false

if this is true, the character's number of jump will be reset when Stomping

◆ StomperMustBeAlive

bool MoreMountains.CorgiEngine.Stompable.StomperMustBeAlive = true

whether or not the stomper has to be alive to be able to stomp this character (set this to false and dead players can still cause damage to this Stompable by falling on it)


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