TopDown Engine  v3.6
MoreMountains.TopDownEngine.DamageOnTouch Class Reference

Add this component to an object and it will cause damage to objects that collide with it. More...

Inheritance diagram for MoreMountains.TopDownEngine.DamageOnTouch:
MoreMountains.Tools.MMMonoBehaviour

Public Types

enum  TriggerAndCollisionMask {
  TriggerAndCollisionMask.IgnoreAll = 0, TriggerAndCollisionMask.OnTriggerEnter = 1 << 0, TriggerAndCollisionMask.OnTriggerStay = 1 << 1, TriggerAndCollisionMask.OnTriggerEnter2D = 1 << 6,
  TriggerAndCollisionMask.OnTriggerStay2D = 1 << 7, TriggerAndCollisionMask.All_3D = OnTriggerEnter | OnTriggerStay, TriggerAndCollisionMask.All_2D = OnTriggerEnter2D | OnTriggerStay2D, TriggerAndCollisionMask.All = All_3D | All_2D
}
 
enum  KnockbackStyles { KnockbackStyles.NoKnockback, KnockbackStyles.AddForce }
 the possible ways to add knockback : noKnockback, which won't do nothing, set force, or add force More...
 
enum  KnockbackDirections { KnockbackDirections.BasedOnOwnerPosition, KnockbackDirections.BasedOnSpeed, KnockbackDirections.BasedOnDirection, KnockbackDirections.BasedOnScriptDirection }
 the possible knockback directions More...
 
enum  DamageDirections { DamageDirections.BasedOnOwnerPosition, DamageDirections.BasedOnVelocity, DamageDirections.BasedOnScriptDirection }
 the possible ways to determine damage directions More...
 

Public Member Functions

virtual void Initialization ()
 Initializes ignore list, feedbacks, colliders and grabs components More...
 
virtual void InitializeFeedbacks ()
 Initializes feedbacks More...
 
virtual void SetGizmoSize (Vector3 newGizmoSize)
 A public method letting you (re)define gizmo size More...
 
virtual void SetGizmoOffset (Vector3 newOffset)
 A public method letting you specify a gizmo offset More...
 
virtual void SetKnockbackScriptDirection (Vector3 newDirection)
 When knockback is in script direction mode, lets you specify the direction of the knockback More...
 
virtual void SetDamageScriptDirection (Vector3 newDirection)
 When damage direction is in script mode, lets you specify the direction of damage More...
 
virtual void IgnoreGameObject (GameObject newIgnoredGameObject)
 Adds the gameobject set in parameters to the ignore list More...
 
virtual void StopIgnoringObject (GameObject ignoredGameObject)
 Removes the object set in parameters from the ignore list More...
 
virtual void ClearIgnoreList ()
 Clears the ignore list. More...
 
virtual void OnTriggerStay2D (Collider2D collider)
 When a collision with the player is triggered, we give damage to the player and knock it back More...
 
virtual void OnTriggerEnter2D (Collider2D collider)
 On trigger enter 2D, we call our colliding endpoint More...
 
virtual void OnTriggerStay (Collider collider)
 On trigger stay, we call our colliding endpoint More...
 
virtual void OnTriggerEnter (Collider collider)
 On trigger enter, we call our colliding endpoint More...
 

Public Attributes

LayerMask TargetLayerMask
 the layers that will be damaged by this object More...
 
GameObject Owner
 the owner of the DamageOnTouch zone More...
 
TriggerAndCollisionMask TriggerFilter = AllowedTriggerCallbacks
 Defines on what triggers the damage should be applied, by default on enter and stay (both 2D and 3D) but this field will let you exclude triggers if needed. More...
 
float MinDamageCaused = 10f
 The min amount of health to remove from the player's health. More...
 
float MaxDamageCaused = 10f
 The max amount of health to remove from the player's health. More...
 
List< TypedDamageTypedDamages
 a list of typed damage definitions that will be applied on top of the base damage More...
 
DamageDirections DamageDirectionMode = DamageDirections.BasedOnVelocity
 how to determine the damage direction passed to the Health damage method, usually you'll use velocity for moving damage areas (projectiles) and owner position for melee weapons More...
 
KnockbackStyles DamageCausedKnockbackType = KnockbackStyles.AddForce
 the type of knockback to apply when causing damage More...
 
KnockbackDirections DamageCausedKnockbackDirection = KnockbackDirections.BasedOnOwnerPosition
 The direction to apply the knockback. More...
 
Vector3 DamageCausedKnockbackForce = new Vector3(10, 10, 10)
 The force to apply to the object that gets damaged - this force will be rotated based on your knockback direction mode. So for example in 3D if you want to be pushed back the opposite direction, focus on the z component, with a force of 0,0,20 for example. More...
 
float InvincibilityDuration = 0.5f
 The duration of the invincibility frames after the hit (in seconds) More...
 
bool RepeatDamageOverTime = false
 Whether or not this damage on touch zone should apply damage over time. More...
 
int AmountOfRepeats = 3
 if in damage over time mode, how many times should damage be repeated? More...
 
float DurationBetweenRepeats = 1f
 if in damage over time mode, the duration, in seconds, between two damages More...
 
bool DamageOverTimeInterruptible = true
 if in damage over time mode, whether or not it can be interrupted (by calling the Health:InterruptDamageOverTime method More...
 
DamageType RepeatedDamageType
 if in damage over time mode, the type of the repeated damage More...
 
Health DamageTakenHealth
 The Health component on which to apply damage taken. If left empty, will attempty to grab one on this object. More...
 
float DamageTakenEveryTime = 0
 The amount of damage taken every time, whether what we collide with is damageable or not. More...
 
float DamageTakenDamageable = 0
 The amount of damage taken when colliding with a damageable object. More...
 
float DamageTakenNonDamageable = 0
 The amount of damage taken when colliding with something that is not damageable. More...
 
KnockbackStyles DamageTakenKnockbackType = KnockbackStyles.NoKnockback
 the type of knockback to apply when taking damage More...
 
Vector3 DamageTakenKnockbackForce = Vector3.zero
 The force to apply to the object that gets damaged. More...
 
float DamageTakenInvincibilityDuration = 0.5f
 The duration of the invincibility frames after the hit (in seconds) More...
 
MMFeedbacks HitDamageableFeedback
 the feedback to play when hitting a Damageable More...
 
MMFeedbacks HitNonDamageableFeedback
 the feedback to play when hitting a non Damageable More...
 
MMFeedbacks HitAnythingFeedback
 the feedback to play when hitting anything More...
 
UnityEvent< HealthHitDamageableEvent
 an event to trigger when hitting a Damageable More...
 
UnityEvent< GameObject > HitNonDamageableEvent
 an event to trigger when hitting a non Damageable More...
 
UnityEvent< GameObject > HitAnythingEvent
 an event to trigger when hitting anything More...
 

Static Public Attributes

const TriggerAndCollisionMask AllowedTriggerCallbacks
 

Protected Member Functions

virtual void Awake ()
 On Awake we initialize our damage on touch area More...
 
virtual void OnEnable ()
 OnEnable we set the start time to the current timestamp More...
 
virtual void GrabComponents ()
 Stores components More...
 
virtual void InitializeColliders ()
 Initializes colliders, setting them as trigger if needed More...
 
virtual void InitializeIgnoreList ()
 Initializes the _ignoredGameObjects list if needed More...
 
virtual void OnDisable ()
 On disable we clear our ignore list More...
 
virtual void OnValidate ()
 On validate we ensure our inspector is in sync More...
 
virtual void InitalizeGizmos ()
 Initializes gizmo colors & settings More...
 
virtual void OnDrawGizmos ()
 draws a cube or sphere around the damage area More...
 
virtual void Update ()
 During last update, we store the position and velocity of the object More...
 
void LateUpdate ()
 On Late Update we store our position More...
 
virtual void ComputeVelocity ()
 Computes the velocity based on the object's last position More...
 
virtual void DetermineDamageDirection ()
 Determine the damage direction to pass to the Health Damage method More...
 
virtual void Colliding (GameObject collider)
 When colliding, we apply the appropriate damage More...
 
virtual bool EvaluateAvailability (GameObject collider)
 Checks whether or not damage should be applied this frame More...
 
virtual void OnCollideWithDamageable (Health health)
 Describes what happens when colliding with a damageable object More...
 
virtual void ApplyKnockback (float damage, List< TypedDamage > typedDamages)
 Applies knockback if needed More...
 
virtual bool ShouldApplyKnockback (float damage, List< TypedDamage > typedDamages)
 Determines whether or not knockback should be applied More...
 
virtual void ApplyKnockback2D ()
 Applies knockback if we're in a 2D context More...
 
virtual void ApplyKnockback3D ()
 Applies knockback if we're in a 3D context More...
 
virtual void OnCollideWithNonDamageable ()
 Describes what happens when colliding with a non damageable object More...
 
virtual void OnAnyCollision (GameObject other)
 Describes what could happens when colliding with anything More...
 
virtual void SelfDamage (float damage)
 Applies damage to itself More...
 

Protected Attributes

Vector3 _lastPosition
 
float _startTime = 0f
 
Health _colliderHealth
 
TopDownController _topDownController
 
TopDownController _colliderTopDownController
 
List< GameObject > _ignoredGameObjects
 
Vector3 _knockbackForceApplied
 
CircleCollider2D _circleCollider2D
 
BoxCollider2D _boxCollider2D
 
SphereCollider _sphereCollider
 
BoxCollider _boxCollider
 
Color _gizmosColor
 
Vector3 _gizmoSize
 
Vector3 _gizmoOffset
 
Transform _gizmoTransform
 
bool _twoD = false
 
bool _initializedFeedbacks = false
 
Vector3 _positionLastFrame
 
Vector3 _knockbackScriptDirection
 
Vector3 _relativePosition
 
Vector3 _damageScriptDirection
 
Health _collidingHealth
 

Detailed Description

Add this component to an object and it will cause damage to objects that collide with it.

Member Enumeration Documentation

◆ DamageDirections

the possible ways to determine damage directions

Enumerator
BasedOnOwnerPosition 
BasedOnVelocity 
BasedOnScriptDirection 

◆ KnockbackDirections

the possible knockback directions

Enumerator
BasedOnOwnerPosition 
BasedOnSpeed 
BasedOnDirection 
BasedOnScriptDirection 

◆ KnockbackStyles

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

Enumerator
NoKnockback 
AddForce 

◆ TriggerAndCollisionMask

Enumerator
IgnoreAll 
OnTriggerEnter 
OnTriggerStay 
OnTriggerEnter2D 
OnTriggerStay2D 
All_3D 
All_2D 
All 

Member Function Documentation

◆ ApplyKnockback()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.ApplyKnockback ( float  damage,
List< TypedDamage typedDamages 
)
protectedvirtual

Applies knockback if needed

◆ ApplyKnockback2D()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.ApplyKnockback2D ( )
protectedvirtual

Applies knockback if we're in a 2D context

◆ ApplyKnockback3D()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.ApplyKnockback3D ( )
protectedvirtual

Applies knockback if we're in a 3D context

◆ Awake()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.Awake ( )
protectedvirtual

On Awake we initialize our damage on touch area

◆ ClearIgnoreList()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.ClearIgnoreList ( )
virtual

Clears the ignore list.

◆ Colliding()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.Colliding ( GameObject  collider)
protectedvirtual

When colliding, we apply the appropriate damage

Parameters
collider

◆ ComputeVelocity()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.ComputeVelocity ( )
protectedvirtual

Computes the velocity based on the object's last position

◆ DetermineDamageDirection()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.DetermineDamageDirection ( )
protectedvirtual

Determine the damage direction to pass to the Health Damage method

◆ EvaluateAvailability()

virtual bool MoreMountains.TopDownEngine.DamageOnTouch.EvaluateAvailability ( GameObject  collider)
protectedvirtual

Checks whether or not damage should be applied this frame

Parameters
collider
Returns

◆ GrabComponents()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.GrabComponents ( )
protectedvirtual

Stores components

◆ IgnoreGameObject()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.IgnoreGameObject ( GameObject  newIgnoredGameObject)
virtual

Adds the gameobject set in parameters to the ignore list

Parameters
newIgnoredGameObjectNew ignored game object.

◆ InitalizeGizmos()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.InitalizeGizmos ( )
protectedvirtual

Initializes gizmo colors & settings

◆ Initialization()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.Initialization ( )
virtual

Initializes ignore list, feedbacks, colliders and grabs components

◆ InitializeColliders()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.InitializeColliders ( )
protectedvirtual

Initializes colliders, setting them as trigger if needed

◆ InitializeFeedbacks()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.InitializeFeedbacks ( )
virtual

Initializes feedbacks

◆ InitializeIgnoreList()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.InitializeIgnoreList ( )
protectedvirtual

Initializes the _ignoredGameObjects list if needed

◆ LateUpdate()

void MoreMountains.TopDownEngine.DamageOnTouch.LateUpdate ( )
protected

On Late Update we store our position

◆ OnAnyCollision()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.OnAnyCollision ( GameObject  other)
protectedvirtual

Describes what could happens when colliding with anything

◆ OnCollideWithDamageable()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.OnCollideWithDamageable ( Health  health)
protectedvirtual

Describes what happens when colliding with a damageable object

Parameters
healthHealth.

◆ OnCollideWithNonDamageable()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.OnCollideWithNonDamageable ( )
protectedvirtual

Describes what happens when colliding with a non damageable object

◆ OnDisable()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.OnDisable ( )
protectedvirtual

On disable we clear our ignore list

◆ OnDrawGizmos()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.OnDrawGizmos ( )
protectedvirtual

draws a cube or sphere around the damage area

◆ OnEnable()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.OnEnable ( )
protectedvirtual

OnEnable we set the start time to the current timestamp

◆ OnTriggerEnter()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.OnTriggerEnter ( Collider  collider)
virtual

On trigger enter, we call our colliding endpoint

Parameters
collider

◆ OnTriggerEnter2D()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.OnTriggerEnter2D ( Collider2D  collider)
virtual

On trigger enter 2D, we call our colliding endpoint

Parameters
collider

S

◆ OnTriggerStay()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.OnTriggerStay ( Collider  collider)
virtual

On trigger stay, we call our colliding endpoint

Parameters
collider

◆ OnTriggerStay2D()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.OnTriggerStay2D ( Collider2D  collider)
virtual

When a collision with the player is triggered, we give damage to the player and knock it back

Parameters
colliderwhat's colliding with the object.

◆ OnValidate()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.OnValidate ( )
protectedvirtual

On validate we ensure our inspector is in sync

◆ SelfDamage()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.SelfDamage ( float  damage)
protectedvirtual

Applies damage to itself

Parameters
damageDamage.

◆ SetDamageScriptDirection()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.SetDamageScriptDirection ( Vector3  newDirection)
virtual

When damage direction is in script mode, lets you specify the direction of damage

Parameters
newDirection

◆ SetGizmoOffset()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.SetGizmoOffset ( Vector3  newOffset)
virtual

A public method letting you specify a gizmo offset

Parameters
newOffset

◆ SetGizmoSize()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.SetGizmoSize ( Vector3  newGizmoSize)
virtual

A public method letting you (re)define gizmo size

Parameters
newGizmoSize

◆ SetKnockbackScriptDirection()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.SetKnockbackScriptDirection ( Vector3  newDirection)
virtual

When knockback is in script direction mode, lets you specify the direction of the knockback

Parameters
newDirection

◆ ShouldApplyKnockback()

virtual bool MoreMountains.TopDownEngine.DamageOnTouch.ShouldApplyKnockback ( float  damage,
List< TypedDamage typedDamages 
)
protectedvirtual

Determines whether or not knockback should be applied

Returns

◆ StopIgnoringObject()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.StopIgnoringObject ( GameObject  ignoredGameObject)
virtual

Removes the object set in parameters from the ignore list

Parameters
ignoredGameObjectIgnored game object.

◆ Update()

virtual void MoreMountains.TopDownEngine.DamageOnTouch.Update ( )
protectedvirtual

During last update, we store the position and velocity of the object

Member Data Documentation

◆ _boxCollider

BoxCollider MoreMountains.TopDownEngine.DamageOnTouch._boxCollider
protected

◆ _boxCollider2D

BoxCollider2D MoreMountains.TopDownEngine.DamageOnTouch._boxCollider2D
protected

◆ _circleCollider2D

CircleCollider2D MoreMountains.TopDownEngine.DamageOnTouch._circleCollider2D
protected

◆ _colliderHealth

Health MoreMountains.TopDownEngine.DamageOnTouch._colliderHealth
protected

◆ _colliderTopDownController

TopDownController MoreMountains.TopDownEngine.DamageOnTouch._colliderTopDownController
protected

◆ _collidingHealth

Health MoreMountains.TopDownEngine.DamageOnTouch._collidingHealth
protected

◆ _damageScriptDirection

Vector3 MoreMountains.TopDownEngine.DamageOnTouch._damageScriptDirection
protected

◆ _gizmoOffset

Vector3 MoreMountains.TopDownEngine.DamageOnTouch._gizmoOffset
protected

◆ _gizmosColor

Color MoreMountains.TopDownEngine.DamageOnTouch._gizmosColor
protected

◆ _gizmoSize

Vector3 MoreMountains.TopDownEngine.DamageOnTouch._gizmoSize
protected

◆ _gizmoTransform

Transform MoreMountains.TopDownEngine.DamageOnTouch._gizmoTransform
protected

◆ _ignoredGameObjects

List<GameObject> MoreMountains.TopDownEngine.DamageOnTouch._ignoredGameObjects
protected

◆ _initializedFeedbacks

bool MoreMountains.TopDownEngine.DamageOnTouch._initializedFeedbacks = false
protected

◆ _knockbackForceApplied

Vector3 MoreMountains.TopDownEngine.DamageOnTouch._knockbackForceApplied
protected

◆ _knockbackScriptDirection

Vector3 MoreMountains.TopDownEngine.DamageOnTouch._knockbackScriptDirection
protected

◆ _lastPosition

Vector3 MoreMountains.TopDownEngine.DamageOnTouch._lastPosition
protected

◆ _positionLastFrame

Vector3 MoreMountains.TopDownEngine.DamageOnTouch._positionLastFrame
protected

◆ _relativePosition

Vector3 MoreMountains.TopDownEngine.DamageOnTouch._relativePosition
protected

◆ _sphereCollider

SphereCollider MoreMountains.TopDownEngine.DamageOnTouch._sphereCollider
protected

◆ _startTime

float MoreMountains.TopDownEngine.DamageOnTouch._startTime = 0f
protected

◆ _topDownController

TopDownController MoreMountains.TopDownEngine.DamageOnTouch._topDownController
protected

◆ _twoD

bool MoreMountains.TopDownEngine.DamageOnTouch._twoD = false
protected

◆ AllowedTriggerCallbacks

const TriggerAndCollisionMask MoreMountains.TopDownEngine.DamageOnTouch.AllowedTriggerCallbacks
static
Initial value:
= TriggerAndCollisionMask.OnTriggerEnter
| TriggerAndCollisionMask.OnTriggerStay
| TriggerAndCollisionMask.OnTriggerEnter2D
| TriggerAndCollisionMask.OnTriggerStay2D

◆ AmountOfRepeats

int MoreMountains.TopDownEngine.DamageOnTouch.AmountOfRepeats = 3

if in damage over time mode, how many times should damage be repeated?

◆ DamageCausedKnockbackDirection

KnockbackDirections MoreMountains.TopDownEngine.DamageOnTouch.DamageCausedKnockbackDirection = KnockbackDirections.BasedOnOwnerPosition

The direction to apply the knockback.

◆ DamageCausedKnockbackForce

Vector3 MoreMountains.TopDownEngine.DamageOnTouch.DamageCausedKnockbackForce = new Vector3(10, 10, 10)

The force to apply to the object that gets damaged - this force will be rotated based on your knockback direction mode. So for example in 3D if you want to be pushed back the opposite direction, focus on the z component, with a force of 0,0,20 for example.

◆ DamageCausedKnockbackType

KnockbackStyles MoreMountains.TopDownEngine.DamageOnTouch.DamageCausedKnockbackType = KnockbackStyles.AddForce

the type of knockback to apply when causing damage

◆ DamageDirectionMode

DamageDirections MoreMountains.TopDownEngine.DamageOnTouch.DamageDirectionMode = DamageDirections.BasedOnVelocity

how to determine the damage direction passed to the Health damage method, usually you'll use velocity for moving damage areas (projectiles) and owner position for melee weapons

◆ DamageOverTimeInterruptible

bool MoreMountains.TopDownEngine.DamageOnTouch.DamageOverTimeInterruptible = true

if in damage over time mode, whether or not it can be interrupted (by calling the Health:InterruptDamageOverTime method

◆ DamageTakenDamageable

float MoreMountains.TopDownEngine.DamageOnTouch.DamageTakenDamageable = 0

The amount of damage taken when colliding with a damageable object.

◆ DamageTakenEveryTime

float MoreMountains.TopDownEngine.DamageOnTouch.DamageTakenEveryTime = 0

The amount of damage taken every time, whether what we collide with is damageable or not.

◆ DamageTakenHealth

Health MoreMountains.TopDownEngine.DamageOnTouch.DamageTakenHealth

The Health component on which to apply damage taken. If left empty, will attempty to grab one on this object.

◆ DamageTakenInvincibilityDuration

float MoreMountains.TopDownEngine.DamageOnTouch.DamageTakenInvincibilityDuration = 0.5f

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

◆ DamageTakenKnockbackForce

Vector3 MoreMountains.TopDownEngine.DamageOnTouch.DamageTakenKnockbackForce = Vector3.zero

The force to apply to the object that gets damaged.

◆ DamageTakenKnockbackType

KnockbackStyles MoreMountains.TopDownEngine.DamageOnTouch.DamageTakenKnockbackType = KnockbackStyles.NoKnockback

the type of knockback to apply when taking damage

◆ DamageTakenNonDamageable

float MoreMountains.TopDownEngine.DamageOnTouch.DamageTakenNonDamageable = 0

The amount of damage taken when colliding with something that is not damageable.

◆ DurationBetweenRepeats

float MoreMountains.TopDownEngine.DamageOnTouch.DurationBetweenRepeats = 1f

if in damage over time mode, the duration, in seconds, between two damages

◆ HitAnythingEvent

UnityEvent<GameObject> MoreMountains.TopDownEngine.DamageOnTouch.HitAnythingEvent

an event to trigger when hitting anything

◆ HitAnythingFeedback

MMFeedbacks MoreMountains.TopDownEngine.DamageOnTouch.HitAnythingFeedback

the feedback to play when hitting anything

◆ HitDamageableEvent

UnityEvent<Health> MoreMountains.TopDownEngine.DamageOnTouch.HitDamageableEvent

an event to trigger when hitting a Damageable

◆ HitDamageableFeedback

MMFeedbacks MoreMountains.TopDownEngine.DamageOnTouch.HitDamageableFeedback

the feedback to play when hitting a Damageable

◆ HitNonDamageableEvent

UnityEvent<GameObject> MoreMountains.TopDownEngine.DamageOnTouch.HitNonDamageableEvent

an event to trigger when hitting a non Damageable

◆ HitNonDamageableFeedback

MMFeedbacks MoreMountains.TopDownEngine.DamageOnTouch.HitNonDamageableFeedback

the feedback to play when hitting a non Damageable

◆ InvincibilityDuration

float MoreMountains.TopDownEngine.DamageOnTouch.InvincibilityDuration = 0.5f

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

◆ MaxDamageCaused

float MoreMountains.TopDownEngine.DamageOnTouch.MaxDamageCaused = 10f

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

◆ MinDamageCaused

float MoreMountains.TopDownEngine.DamageOnTouch.MinDamageCaused = 10f

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

◆ Owner

GameObject MoreMountains.TopDownEngine.DamageOnTouch.Owner

the owner of the DamageOnTouch zone

◆ RepeatDamageOverTime

bool MoreMountains.TopDownEngine.DamageOnTouch.RepeatDamageOverTime = false

Whether or not this damage on touch zone should apply damage over time.

◆ RepeatedDamageType

DamageType MoreMountains.TopDownEngine.DamageOnTouch.RepeatedDamageType

if in damage over time mode, the type of the repeated damage

◆ TargetLayerMask

LayerMask MoreMountains.TopDownEngine.DamageOnTouch.TargetLayerMask

the layers that will be damaged by this object

◆ TriggerFilter

TriggerAndCollisionMask MoreMountains.TopDownEngine.DamageOnTouch.TriggerFilter = AllowedTriggerCallbacks

Defines on what triggers the damage should be applied, by default on enter and stay (both 2D and 3D) but this field will let you exclude triggers if needed.

◆ TypedDamages

List<TypedDamage> MoreMountains.TopDownEngine.DamageOnTouch.TypedDamages

a list of typed damage definitions that will be applied on top of the base damage


The documentation for this class was generated from the following file:
MoreMountains.TopDownEngine.DamageOnTouch.TriggerAndCollisionMask
TriggerAndCollisionMask
Definition: DamageOnTouch.cs:20