Corgi Engine
v9.1
|
Add this class to an enemy (or whatever you want), to be able to stomp on it More...
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 |
Add this class to an enemy (or whatever you want), to be able to stomp on it
|
protectedvirtual |
Casts the rays above to detect stomping
|
protectedvirtual |
Returns true if the hit is coming from above
|
protectedvirtual |
Initializes the ray origins
|
protectedvirtual |
Each update, we cast rays above
|
protectedvirtual |
Performs the stomp.
corgiController | Corgi controller. |
|
protectedvirtual |
On start, we get the various components
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
KnockbackStyles MoreMountains.CorgiEngine.Stompable.DamageCausedKnockbackType = KnockbackStyles.SetForce |
the type of knockback to apply when causing damage
int MoreMountains.CorgiEngine.Stompable.DamagePerStomp |
The amount of damage each stomp causes to the stomped enemy.
float MoreMountains.CorgiEngine.Stompable.InvincibilityDuration = 0.5f |
the duration of the invincibility after a stomp
Vector2 MoreMountains.CorgiEngine.Stompable.KnockbackForce = new Vector2(0f,15f) |
The force the hit will apply to the stomper.
int MoreMountains.CorgiEngine.Stompable.NumberOfRays = 5 |
The number of vertical rays cast to detect stomping.
LayerMask MoreMountains.CorgiEngine.Stompable.PlayerMask = LayerManager.PlayerLayerMask |
The layer the player is on.
float MoreMountains.CorgiEngine.Stompable.RaycastLength = 0.5f |
the length of the rays
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).
bool MoreMountains.CorgiEngine.Stompable.ResetNumberOfJumpsOnStomp = false |
if this is true, the character's number of jump will be reset when Stomping
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)