Corgi Engine v9.4
Loading...
Searching...
No Matches
MoreMountains.CorgiEngine.MeleeWeapon Class Reference

A basic melee weapon class, that will activate a "hurt zone" when the weapon is used. More...

Inheritance diagram for MoreMountains.CorgiEngine.MeleeWeapon:
MoreMountains.CorgiEngine.Weapon MoreMountains.Tools.MMMonoBehaviour

Public Types

enum  MeleeDamageAreaShapes { Rectangle , Circle }
 the possible shapes for the melee weapon's damage area More...
enum  MeleeDamageAreaModes { Generated , Existing }
Public Types inherited from MoreMountains.CorgiEngine.Weapon
enum  TriggerModes { SemiAuto , Auto }
 the possible use modes for the trigger More...
enum  WeaponStates {
  WeaponIdle , WeaponStart , WeaponDelayBeforeUse , WeaponUse ,
  WeaponDelayBetweenUses , WeaponStop , WeaponReloadNeeded , WeaponReloadStart ,
  WeaponReload , WeaponReloadStop , WeaponInterrupted , WeaponInCooldown
}
 the possible states the weapon can be in More...

Public Member Functions

override void Initialization ()
 Initialization.
override void TurnWeaponOff ()
 On TurnWeaponOff we stop our coroutine and damage area if needed.
Public Member Functions inherited from MoreMountains.CorgiEngine.Weapon
virtual void InitializeComboWeapons ()
 Initializes the combo comp if found.
virtual void SetOwner (Character newOwner, CharacterHandleWeapon handleWeapon)
 Sets the weapon's owner.
virtual void WeaponInputStart ()
 Called by input, turns the weapon on.
virtual void WeaponInputReleased ()
 Describes what happens when the weapon's input gets released.
virtual void WeaponInputStop ()
 Called by input, turns the weapon off if in auto mode.
virtual void TurnWeaponOn ()
 Describes what happens when the weapon starts.
virtual void Interrupt ()
 Call this method to interrupt the weapon.
virtual bool WeaponInCooldown ()
virtual void SetCooldownStartAt ()
virtual void ResetCooldown ()
 Lets you reset the cooldown of the weapon.
virtual IEnumerator ShootRequestCo ()
 Determines whether or not the weapon can fire.
virtual void InitiateReloadWeapon ()
virtual void FlipWeapon ()
 Flips the weapon.
virtual void FlipWeaponModel ()
 Flips the weapon model.
virtual IEnumerator WeaponDestruction ()
 Destroys the weapon.
virtual void ApplyRecoil (bool shouldApplyRecoil, WeaponRecoilProperties properties)
virtual void InitializeAnimatorParameters ()
 Adds required animator parameters to the animator parameters list if they exist.
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().
virtual void ResetComboAnimatorParameter ()
virtual void ResetAnimatorParameters ()
virtual void WeaponHit ()
virtual void WeaponHitDamageable ()
virtual void WeaponHitNonDamageable ()
virtual void WeaponMiss ()
virtual void WeaponKill ()

Public Attributes

MeleeDamageAreaModes MeleeDamageAreaMode = MeleeDamageAreaModes.Generated
 the possible modes to handle the damage area. In Generated, the MeleeWeapon will create it, in Existing, you can bind an existing damage area - usually nested under the weapon
MeleeDamageAreaShapes DamageAreaShape = MeleeDamageAreaShapes.Rectangle
 the shape of the damage area (rectangle or circle)
Vector2 AreaOffset = new Vector2(1,0)
 the offset to apply to the damage area (from the weapon's attachment position
Vector2 AreaSize = new Vector2(1,1)
 the size of the damage area
DamageOnTouch ExistingDamageArea
 an existing damage area to activate/handle as the weapon is used
float InitialDelay = 0f
 the initial delay to apply before triggering the damage area
float ActiveDuration = 1f
 the duration during which the damage area is active
LayerMask TargetLayerMask
 the layers that will be damaged by this object
bool ApplyDamageOnTriggerEnter = true
 if this is true, the damage will apply on trigger enter
bool ApplyDamageOnTriggerStay = true
 if this is true, the damage will apply on trigger stay
int MinDamageCaused = 10
 The min amount of health to remove from the player's health.
int MaxDamageCaused = 0
 The max amount of health to remove from the player's health - has to be above MinDamageCaused, otherwise it'll be set to MinDamageCaused.
DamageOnTouch.KnockbackStyles Knockback
 the kind of knockback to apply
Vector2 KnockbackForce = new Vector2(10,2)
 The force to apply to the object that gets damaged.
float InvincibilityDuration = 0.5f
 The duration of the invincibility frames after the hit (in seconds)
Public Attributes inherited from MoreMountains.CorgiEngine.Weapon
TriggerModes TriggerMode = TriggerModes.Auto
 is this weapon on semi or full auto ?
bool Interruptable = false
 whether or not this weapon can be interrupted
bool InitializeOnStart = false
 If this is true, the weapon will initialize itself on start, otherwise it'll have to be init manually, usually by the CharacterHandleWeapon class.
float DelayBeforeUse = 0f
 the delay before use, that will be applied for every shot
bool DelayBeforeUseReleaseInterruption = true
 whether or not the delay before used can be interrupted by releasing the shoot button (if true, releasing the button will cancel the delayed shot)
float TimeBetweenUses = 1f
 the time (in seconds) between two shots
bool TimeBetweenUsesReleaseInterruption = true
 whether or not the time between uses can be interrupted by releasing the shoot button (if true, releasing the button will cancel the time between uses)
float CooldownDuration = 0f
 a duration, in seconds, at the end of the weapon's life cycle and before going back to Idle
bool UseBurstMode = false
 if this is true, the weapon will activate repeatedly for every shoot request
int BurstLength = 3
 the amount of 'shots' in a burst sequence
float BurstTimeBetweenShots = 0.1f
 the time between shots in a burst sequence (in seconds)
bool MagazineBased = false
 whether or not the weapon is magazine based. If it's not, it'll just take its ammo inside a global pool
int MagazineSize = 30
 the size of the magazine
bool AutoReload
 if this is true, pressing the fire button when a reload is needed will reload the weapon. Otherwise you'll need to press the reload button
float ReloadTime = 2f
 the time it takes to reload the weapon
int AmmoConsumedPerShot = 1
 the amount of ammo consumed everytime the weapon fires
bool AutoDestroyWhenEmpty
 if this is set to true, the weapon will auto destroy when there's no ammo left
float AutoDestroyWhenEmptyDelay = 1f
 the delay (in seconds) before weapon destruction if empty
int CurrentAmmoLoaded = 0
 the current amount of ammo loaded inside the weapon
Vector3 WeaponAttachmentOffset = Vector3.zero
 an offset that will be applied to the weapon once attached to the center of the WeaponAttachment transform.
bool FlipWeaponOnCharacterFlip = true
 should that weapon be flipped when the character flips ?
Vector3 FlipValue = new Vector3(-1,1,1)
 the FlipValue will be used to multiply the model's transform's localscale on flip. Usually it's -1,1,1, but feel free to change it to suit your model's specs
Transform LeftHandHandle
 the transform to which the character's left hand should be attached to
Transform RightHandHandle
 the transform to which the character's right hand should be attached to
bool ModifyMovementWhileEquipped = false
 if this is true, a multiplier will be applied to movement while the weapon is equipped
float PermanentMovementMultiplier = 0f
 the multiplier to apply to movement while equipped
bool ModifyMovementWhileAttacking = false
 if this is true, a multiplier will be applied to movement while the weapon is active
float MovementMultiplier = 0f
 the multiplier to apply to movement while attacking
bool AlwaysResetMultiplierToInitial = true
 if this is true, movement will always be reset to initial speed after a multiplier stops being applied
bool PreventHorizontalGroundMovementWhileInUse = false
 if this is true all movement will be prevented (even flip) while the weapon is active
bool PreventHorizontalAirMovementWhileInUse = false
 if this is true all horizontal air movement will be prevented (even flip) while the weapon is active
bool SetForceWhileInUse = false
 whether or not to apply a force when the weapon is in use
Vector2 ForceWhileInUse = Vector2.zero
 the force to apply when the weapon is in use, if SetForceWhileInUse is true
bool DisableGravityWhileInUse = false
 whether or not to disable gravity while the weapon is in use
bool PreventFlipWhileInUse = false
 whether or not to disable flip while the weapon is in use
List< Animator > Animators
 the other animators (other than the Character's) that you want to update every time this weapon gets used
bool MirrorCharacterAnimatorParameters = false
 if this is true, the weapon's animator(s) will mirror the animation parameter of the owner character (that way your weapon's animator will be able to "know" if the character is walking, jumping, etc)
string EquippedAnimationParameter
string IdleAnimationParameter
 the name of the weapon's idle animation parameter : this will be true all the time except when the weapon is being used
string StartAnimationParameter
 the name of the weapon's start animation parameter : true at the frame where the weapon starts being used
string DelayBeforeUseAnimationParameter
 the name of the weapon's delay before use animation parameter : true when the weapon has been activated but hasn't been used yet
string SingleUseAnimationParameter
 the name of the weapon's single use animation parameter : true at each frame the weapon activates (shoots)
string UseAnimationParameter
 the name of the weapon's in use animation parameter : true at each frame the weapon has started firing but hasn't stopped yet
string DelayBetweenUsesAnimationParameter
 the name of the weapon's delay between each use animation parameter : true when the weapon is in use
string InCooldownAnimationParameter
 the name of the weapon's in cooldown animation parameter : true when the weapon is in cooldown
string StopAnimationParameter
 the name of the weapon stop animation parameter : true after a shot and before the next one or the weapon's stop
string ReloadStartAnimationParameter
 the name of the weapon reload start animation parameter
string ReloadAnimationParameter
 the name of the weapon reload animation parameter
string ReloadStopAnimationParameter
 the name of the weapon reload end animation parameter
string WeaponAngleAnimationParameter
 the name of the weapon's angle animation parameter
string WeaponAngleRelativeAnimationParameter
 the name of the weapon's angle animation parameter, adjusted so it's always relative to the direction the character is currently facing
MMFeedbacks WeaponStartMMFeedback
 the feedback to play when the weapon starts being used
MMFeedbacks WeaponUsedMMFeedback
 the feedback to play while the weapon is in use
MMFeedbacks WeaponStopMMFeedback
 the feedback to play when the weapon stops being used
MMFeedbacks WeaponReloadMMFeedback
 the feedback to play when the weapon gets reloaded
MMFeedbacks WeaponReloadNeededMMFeedback
 the feedback to play when the weapon gets reloaded
MMFeedbacks WeaponOnHitFeedback
 A MMFeedback to play when the weapon hits anything (damageable or not)
MMFeedbacks WeaponOnMissFeedback
 A MMFeedback to play when the weapon misses (what constitutes a miss is defined per Weapon subclass)
MMFeedbacks WeaponOnHitDamageableFeedback
 A MMFeedback to play when the weapon hits a damageable.
MMFeedbacks WeaponOnHitNonDamageableFeedback
 A MMFeedback to play when the weapon hits a non damageable object.
MMFeedbacks WeaponOnKillFeedback
 A MMFeedback to play when the weapon kills something.
bool ApplyRecoilOnUse = false
 Whether or not to apply recoil to the Weapon owner every time this weapon gets used, regardless of the outcome.
WeaponRecoilProperties RecoilOnUseProperties
 The recoil to apply every time this weapon gets used.
bool ApplyRecoilOnHitDamageable = false
 Whether or not to apply recoil to the Weapon owner every time this weapon hits a damageable object (an object with a Health component, basically)
WeaponRecoilProperties RecoilOnHitDamageableProperties
 the recoil to apply when this weapon hits a damageable
bool ApplyRecoilOnHitNonDamageable = false
 Whether or not to apply recoil to the Weapon owner every time this weapon hits a non damageable object (a platform, prop, etc)
WeaponRecoilProperties RecoilOnHitNonDamageableProperties
 the recoil to apply when this weapon hits a non damageable
bool ApplyRecoilOnMiss = false
 Whether or not to apply recoil to the Weapon owner every time the weapon misses its hit.
WeaponRecoilProperties RecoilOnMissProperties
 the recoil to apply when this weapon hits nothing
bool ApplyRecoilOnKill = false
 Whether or not to apply recoil to the Weapon owner every time the weapon kills its target.
WeaponRecoilProperties RecoilOnKillProperties
 The recoil to apply on kill.
MMStateMachine< WeaponStatesWeaponState
 the weapon's state machine

Protected Member Functions

virtual void CreateDamageArea ()
 Creates the damage area.
override void WeaponUse ()
 When the weapon is used, we trigger our attack routine.
virtual IEnumerator MeleeWeaponAttack ()
 Triggers an attack, turning the damage area on and then off.
virtual void EnableDamageArea ()
 Enables the damage area.
virtual void HandleMiss ()
 Triggers a weapon miss if no hit was detected last frame.
virtual void DisableDamageArea ()
 Disables the damage area.
virtual void DrawGizmos ()
 Draws the melee weapon's range.
virtual void OnDrawGizmosSelected ()
 Draws gizmos on selected if the app is not playing.
virtual void OnHit ()
 When we get a hit, we trigger one on the main class.
virtual void OnHitDamageable ()
 When we get a HitDamageable, we trigger one on the main class.
virtual void OnHitNonDamageable ()
 When we get a HitNonDamageable, we trigger one on the main class.
virtual void OnKill ()
 When we get a Kill, we trigger one on the main class.
virtual void RegisterEvents ()
 On enable, we reset the object's speed.
virtual void OnEnable ()
 On enable we register to events if needed.
override void OnDisable ()
 On Disable we unsubscribe from our delegates.
Protected Member Functions inherited from MoreMountains.CorgiEngine.Weapon
virtual void Start ()
virtual void InitializeFeedbacks ()
 Initializes all the feedbacks associated to this weapon.
virtual void Update ()
 On Update, we check if the weapon is or should be used.
virtual void LateUpdate ()
 On LateUpdate, processes the weapon state.
virtual void PreventMovement ()
 Handles movement prevention in air or on ground.
virtual void RestoreMovement ()
virtual IEnumerator ApplyForceWhileInUseCo ()
 An internal coroutine used to apply a force while the weapon's in use.
virtual void ProcessWeaponState ()
 Called every lastUpdate, processes the weapon's state machine.
virtual void CaseWeaponIdle ()
virtual void CaseWeaponStart ()
virtual void CaseWeaponDelayBeforeUse ()
virtual void CaseWeaponUse ()
virtual void CaseWeaponDelayBetweenUses ()
virtual void CaseWeaponStop ()
virtual void CaseWeaponInCooldown ()
virtual void CaseWeaponReloadNeeded ()
virtual void CaseWeaponReloadStart ()
virtual void CaseWeaponReload ()
virtual void CaseWeaponReloadStop ()
virtual void CaseWeaponInterrupted ()
virtual void ShootRequest ()
 Determines whether or not the weapon can fire.
virtual void ResetMovementMultiplier ()
virtual void ReloadNeeded ()
 Describes what happens when the weapon needs a reload.
virtual void ReloadWeapon ()
 Reloads the weapon.
virtual void ApplyOffset ()
 Applies the offset specified in the inspector.
virtual IEnumerator ApplyRecoilCoroutine (WeaponRecoilProperties properties)
virtual void ApplyRecoilInternal (WeaponRecoilProperties properties)
virtual Vector2 GetRecoilDirection (WeaponRecoilProperties properties)
virtual void TriggerWeaponStartFeedback ()
 Plays the weapon's start sound.
virtual void TriggerWeaponUsedFeedback ()
 Plays the weapon's used sound.
virtual void TriggerWeaponStopFeedback ()
 Plays the weapon's stop sound.
virtual void TriggerWeaponReloadNeededFeedback ()
 Plays the weapon's reload needed sound.
virtual void TriggerWeaponReloadFeedback ()
 Plays the weapon's reload sound.
virtual void TriggerWeaponOnHitFeedback ()
 Plays a feedback when the weapon hits something.
virtual void TriggerWeaponOnMissFeedback ()
 Plays a feedback when the weapon doesn't hit something.
virtual void TriggerWeaponOnHitDamageableFeedback ()
 Plays a feedback when the weapon hits a damageable.
virtual void TriggerWeaponOnHitNonDamageableFeedback ()
 Plays a feedback when the weapon hits a non damageable.
virtual void TriggerWeaponOnKillFeedback ()
 Plays a feedback when the weapon kills something.
virtual void AddParametersToAnimator (Animator animator, HashSet< int > list)
virtual void UpdateAnimator (Animator animator, HashSet< int > list)
virtual void ResetAnimatorParameters (Animator animator, HashSet< int > list)

Protected Attributes

Collider2D _damageAreaCollider
bool _attackInProgress = false
Color _gizmosColor
Vector3 _gizmoSize
CircleCollider2D _circleCollider2D
BoxCollider2D _boxCollider2D
Vector3 _gizmoOffset
DamageOnTouch _damageOnTouch
GameObject _damageArea
bool _hitEventSent = false
bool _hitDamageableEventSent = false
bool _hitNonDamageableEventSent = false
bool _killEventSent = false
bool _eventsRegistered = false
Coroutine _meleeWeaponAttack
Protected Attributes inherited from MoreMountains.CorgiEngine.Weapon
SpriteRenderer _spriteRenderer
CharacterGravity _characterGravity
CorgiController _controller
CharacterHorizontalMovement _characterHorizontalMovement
WeaponAim _aimableWeapon
float _permanentMovementMultiplierStorage = 1f
float _movementMultiplierStorage = 1f
Animator _ownerAnimator
float _delayBeforeUseCounter = 0f
float _delayBetweenUsesCounter = 0f
float _cooldownStartAt = float.NegativeInfinity
float _reloadingCounter = 0f
bool _triggerReleased = false
bool _reloading = false
ComboWeapon _comboWeapon
Vector3 _weaponOffset
Vector3 _weaponAttachmentOffset
Transform _weaponAttachment
List< HashSet< int > > _animatorParameters
HashSet< int > _ownerAnimatorParameters
bool _initialized = false
bool _applyForceWhileInUse = false
Vector2 _forceWhileInUse
bool _movementMultiplierNeedsResetting = false
int _equippedAnimationParameter
int _idleAnimationParameter
int _startAnimationParameter
int _delayBeforeUseAnimationParameter
int _singleUseAnimationParameter
int _useAnimationParameter
int _delayBetweenUsesAnimationParameter
int _inCooldownAnimationParameter
int _stopAnimationParameter
int _reloadStartAnimationParameter
int _reloadAnimationParameter
int _reloadStopAnimationParameter
int _weaponAngleAnimationParameter
int _weaponAngleRelativeAnimationParameter
int _aliveAnimationParameter
int _comboInProgressAnimationParameter
Vector2 _recoilDirection
bool _characterHorizontalMovementNotNull = false
bool _controllerNotNull = false
float _lastTurnWeaponOnAt = -float.MaxValue
bool _gravityBeforeUse = true
bool _canFlipBeforeUse = true
Vector3 _newHandleAngles

Additional Inherited Members

Static Protected Attributes inherited from MoreMountains.CorgiEngine.Weapon
const string _aliveAnimationParameterName = "Alive"
Properties inherited from MoreMountains.CorgiEngine.Weapon
string WeaponID [get, set]
 the name of the inventory item corresponding to this weapon. Automatically set (if needed) by InventoryEngineWeapon
Character Owner [get, protected set]
 the weapon's owner
CharacterHandleWeapon CharacterHandleWeapon [get, set]
 the weapon's owner's CharacterHandleWeapon component
bool Flipped [get, set]
 if true, the weapon is flipped
WeaponAmmo WeaponAmmo [get, protected set]
 the WeaponAmmo component optionnally associated to this weapon

Detailed Description

A basic melee weapon class, that will activate a "hurt zone" when the weapon is used.

Member Enumeration Documentation

◆ MeleeDamageAreaModes

Enumerator
Generated 
Existing 

◆ MeleeDamageAreaShapes

the possible shapes for the melee weapon's damage area

Enumerator
Rectangle 
Circle 

Member Function Documentation

◆ CreateDamageArea()

virtual void MoreMountains.CorgiEngine.MeleeWeapon.CreateDamageArea ( )
protectedvirtual

Creates the damage area.

◆ DisableDamageArea()

virtual void MoreMountains.CorgiEngine.MeleeWeapon.DisableDamageArea ( )
protectedvirtual

Disables the damage area.

◆ DrawGizmos()

virtual void MoreMountains.CorgiEngine.MeleeWeapon.DrawGizmos ( )
protectedvirtual

Draws the melee weapon's range.

◆ EnableDamageArea()

virtual void MoreMountains.CorgiEngine.MeleeWeapon.EnableDamageArea ( )
protectedvirtual

Enables the damage area.

◆ HandleMiss()

virtual void MoreMountains.CorgiEngine.MeleeWeapon.HandleMiss ( )
protectedvirtual

Triggers a weapon miss if no hit was detected last frame.

◆ Initialization()

override void MoreMountains.CorgiEngine.MeleeWeapon.Initialization ( )
virtual

Initialization.

Reimplemented from MoreMountains.CorgiEngine.Weapon.

◆ MeleeWeaponAttack()

virtual IEnumerator MoreMountains.CorgiEngine.MeleeWeapon.MeleeWeaponAttack ( )
protectedvirtual

Triggers an attack, turning the damage area on and then off.

Returns
The weapon attack.

◆ OnDisable()

override void MoreMountains.CorgiEngine.MeleeWeapon.OnDisable ( )
protectedvirtual

On Disable we unsubscribe from our delegates.

Reimplemented from MoreMountains.CorgiEngine.Weapon.

◆ OnDrawGizmosSelected()

virtual void MoreMountains.CorgiEngine.MeleeWeapon.OnDrawGizmosSelected ( )
protectedvirtual

Draws gizmos on selected if the app is not playing.

◆ OnEnable()

virtual void MoreMountains.CorgiEngine.MeleeWeapon.OnEnable ( )
protectedvirtual

On enable we register to events if needed.

◆ OnHit()

virtual void MoreMountains.CorgiEngine.MeleeWeapon.OnHit ( )
protectedvirtual

When we get a hit, we trigger one on the main class.

◆ OnHitDamageable()

virtual void MoreMountains.CorgiEngine.MeleeWeapon.OnHitDamageable ( )
protectedvirtual

When we get a HitDamageable, we trigger one on the main class.

◆ OnHitNonDamageable()

virtual void MoreMountains.CorgiEngine.MeleeWeapon.OnHitNonDamageable ( )
protectedvirtual

When we get a HitNonDamageable, we trigger one on the main class.

◆ OnKill()

virtual void MoreMountains.CorgiEngine.MeleeWeapon.OnKill ( )
protectedvirtual

When we get a Kill, we trigger one on the main class.

◆ RegisterEvents()

virtual void MoreMountains.CorgiEngine.MeleeWeapon.RegisterEvents ( )
protectedvirtual

On enable, we reset the object's speed.

◆ TurnWeaponOff()

override void MoreMountains.CorgiEngine.MeleeWeapon.TurnWeaponOff ( )
virtual

On TurnWeaponOff we stop our coroutine and damage area if needed.

Reimplemented from MoreMountains.CorgiEngine.Weapon.

◆ WeaponUse()

override void MoreMountains.CorgiEngine.MeleeWeapon.WeaponUse ( )
protectedvirtual

When the weapon is used, we trigger our attack routine.

Reimplemented from MoreMountains.CorgiEngine.Weapon.

Member Data Documentation

◆ _attackInProgress

bool MoreMountains.CorgiEngine.MeleeWeapon._attackInProgress = false
protected

◆ _boxCollider2D

BoxCollider2D MoreMountains.CorgiEngine.MeleeWeapon._boxCollider2D
protected

◆ _circleCollider2D

CircleCollider2D MoreMountains.CorgiEngine.MeleeWeapon._circleCollider2D
protected

◆ _damageArea

GameObject MoreMountains.CorgiEngine.MeleeWeapon._damageArea
protected

◆ _damageAreaCollider

Collider2D MoreMountains.CorgiEngine.MeleeWeapon._damageAreaCollider
protected

◆ _damageOnTouch

DamageOnTouch MoreMountains.CorgiEngine.MeleeWeapon._damageOnTouch
protected

◆ _eventsRegistered

bool MoreMountains.CorgiEngine.MeleeWeapon._eventsRegistered = false
protected

◆ _gizmoOffset

Vector3 MoreMountains.CorgiEngine.MeleeWeapon._gizmoOffset
protected

◆ _gizmosColor

Color MoreMountains.CorgiEngine.MeleeWeapon._gizmosColor
protected

◆ _gizmoSize

Vector3 MoreMountains.CorgiEngine.MeleeWeapon._gizmoSize
protected

◆ _hitDamageableEventSent

bool MoreMountains.CorgiEngine.MeleeWeapon._hitDamageableEventSent = false
protected

◆ _hitEventSent

bool MoreMountains.CorgiEngine.MeleeWeapon._hitEventSent = false
protected

◆ _hitNonDamageableEventSent

bool MoreMountains.CorgiEngine.MeleeWeapon._hitNonDamageableEventSent = false
protected

◆ _killEventSent

bool MoreMountains.CorgiEngine.MeleeWeapon._killEventSent = false
protected

◆ _meleeWeaponAttack

Coroutine MoreMountains.CorgiEngine.MeleeWeapon._meleeWeaponAttack
protected

◆ ActiveDuration

float MoreMountains.CorgiEngine.MeleeWeapon.ActiveDuration = 1f

the duration during which the damage area is active

◆ ApplyDamageOnTriggerEnter

bool MoreMountains.CorgiEngine.MeleeWeapon.ApplyDamageOnTriggerEnter = true

if this is true, the damage will apply on trigger enter

◆ ApplyDamageOnTriggerStay

bool MoreMountains.CorgiEngine.MeleeWeapon.ApplyDamageOnTriggerStay = true

if this is true, the damage will apply on trigger stay

◆ AreaOffset

Vector2 MoreMountains.CorgiEngine.MeleeWeapon.AreaOffset = new Vector2(1,0)

the offset to apply to the damage area (from the weapon's attachment position

◆ AreaSize

Vector2 MoreMountains.CorgiEngine.MeleeWeapon.AreaSize = new Vector2(1,1)

the size of the damage area

◆ DamageAreaShape

MeleeDamageAreaShapes MoreMountains.CorgiEngine.MeleeWeapon.DamageAreaShape = MeleeDamageAreaShapes.Rectangle

the shape of the damage area (rectangle or circle)

◆ ExistingDamageArea

DamageOnTouch MoreMountains.CorgiEngine.MeleeWeapon.ExistingDamageArea

an existing damage area to activate/handle as the weapon is used

◆ InitialDelay

float MoreMountains.CorgiEngine.MeleeWeapon.InitialDelay = 0f

the initial delay to apply before triggering the damage area

◆ InvincibilityDuration

float MoreMountains.CorgiEngine.MeleeWeapon.InvincibilityDuration = 0.5f

The duration of the invincibility frames after the hit (in seconds)

◆ Knockback

DamageOnTouch.KnockbackStyles MoreMountains.CorgiEngine.MeleeWeapon.Knockback

the kind of knockback to apply

◆ KnockbackForce

Vector2 MoreMountains.CorgiEngine.MeleeWeapon.KnockbackForce = new Vector2(10,2)

The force to apply to the object that gets damaged.

◆ MaxDamageCaused

int MoreMountains.CorgiEngine.MeleeWeapon.MaxDamageCaused = 0

The max amount of health to remove from the player's health - has to be above MinDamageCaused, otherwise it'll be set to MinDamageCaused.

◆ MeleeDamageAreaMode

MeleeDamageAreaModes MoreMountains.CorgiEngine.MeleeWeapon.MeleeDamageAreaMode = MeleeDamageAreaModes.Generated

the possible modes to handle the damage area. In Generated, the MeleeWeapon will create it, in Existing, you can bind an existing damage area - usually nested under the weapon

◆ MinDamageCaused

int MoreMountains.CorgiEngine.MeleeWeapon.MinDamageCaused = 10

The min amount of health to remove from the player's health.

◆ TargetLayerMask

LayerMask MoreMountains.CorgiEngine.MeleeWeapon.TargetLayerMask

the layers that will be damaged by this object


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