TopDown Engine  v4.1
MoreMountains.TopDownEngine.ExplodudesBomb Class Reference

A class used in the Explodudes demo scene to handle the exploding bombs More...

Inheritance diagram for MoreMountains.TopDownEngine.ExplodudesBomb:
MoreMountains.TopDownEngine.TopDownMonoBehaviour MoreMountains.Tools.MMMonoBehaviour

Public Member Functions

virtual void Detonate ()
 Detonates the bomb More...
 
virtual void OnEnable ()
 When the object gets spawned, we initialize it More...
 

Public Attributes

Transform BombModel
 the model of the bomb More...
 
ParticleSystem DirectedExplosionN
 the particle system used for the northbound explosion More...
 
ParticleSystem DirectedExplosionS
 the particle system used for the southbound explosion More...
 
ParticleSystem DirectedExplosionE
 the particle system used for the eastbound explosion More...
 
ParticleSystem DirectedExplosionW
 the particle system used for the westbound explosion More...
 
Vector3 RaycastOffset = Vector3.zero
 the offset to apply to the base of the obstacle detecting raycast More...
 
float MaximumRaycastDistance = 50f
 the max distance of the raycast (should be bigger than the grid) More...
 
LayerMask ObstaclesMask = LayerManager.ObstaclesLayerMask
 the layers to consider as obstacles to the bomb's fire More...
 
LayerMask DamageLayerMask
 the layers to apply damage to More...
 
float SkinWidth = 0.01f
 a small offset to apply to the raycasts More...
 
float BombDelayBeforeExplosion = 3f
 the delay (in seconds) before the bomb's explosion More...
 
float BombExplosionActiveDuration = 0.5f
 the duration (in seconds) for which the bomb is active More...
 
float BombAdditionalDelayBeforeDestruction = 1.5f
 a delay after the bomb has exploded and before it gets destroyed(in seconds) More...
 
int BombDamage = 10
 the damage applied by the bomb to anything with a Health component More...
 
int BombDistanceInGridUnits = 3
 the distance the bomb affects More...
 
MMFeedbacks ExplosionFeedbacks
 the feedbacks to play when the bomb explodes More...
 
GameObject Owner
 the owner of the bomb More...
 

Protected Member Functions

virtual void Awake ()
 On Start we initialize our bomb More...
 
virtual void Initialization ()
 Initializes the bomb More...
 
virtual void ResetBomb ()
 Resets the bomb (usually after having been respawned from the pool) More...
 
virtual DamageOnTouch CreateDamageArea (string name)
 Creates a directed damage area More...
 
virtual IEnumerator DelayBeforeExplosionCoroutine ()
 Applies a delay before exploding the bomb More...
 
virtual IEnumerator DetonateCoroutine ()
 Detonates the bomb and instantiates damage areas More...
 
virtual void DirectedExplosion (RaycastHit hit, DamageOnTouch damageArea, ParticleSystem explosion, float angle)
 Explodes in one of the 4 directions More...
 
virtual void CastRays ()
 Casts 4 cardinal rays to look for obstacles and victims More...
 
virtual void OnTriggerExit (Collider collider)
 When the owner of the bomb exits it, we make it an obstacle More...
 

Protected Attributes

BoxCollider _boxCollider
 
WaitForSeconds _bombDuration
 
WaitForSeconds _explosionDuration
 
WaitForSeconds _additionalDelayBeforeDestruction
 
RaycastHit _raycastNorth
 
RaycastHit _raycastSouth
 
RaycastHit _raycastEast
 
RaycastHit _raycastWest
 
float _obstacleNorthDistance = 0f
 
float _obstacleEastDistance = 0f
 
float _obstacleWestDistance = 0f
 
float _obstacleSouthDistance = 0f
 
DamageOnTouch _damageAreaEast
 
DamageOnTouch _damageAreaWest
 
DamageOnTouch _damageAreaNorth
 
DamageOnTouch _damageAreaSouth
 
DamageOnTouch _damageAreaCenter
 
Vector3 _damageAreaPosition
 
Vector3 _damageAreaSize
 
Coroutine _delayBeforeExplosionCoroutine
 
ExplodudesBomb _otherBomb
 
bool _exploded = false
 

Detailed Description

A class used in the Explodudes demo scene to handle the exploding bombs

Member Function Documentation

◆ Awake()

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

On Start we initialize our bomb

◆ CastRays()

virtual void MoreMountains.TopDownEngine.ExplodudesBomb.CastRays ( )
protectedvirtual

Casts 4 cardinal rays to look for obstacles and victims

◆ CreateDamageArea()

virtual DamageOnTouch MoreMountains.TopDownEngine.ExplodudesBomb.CreateDamageArea ( string  name)
protectedvirtual

Creates a directed damage area

Parameters
name
Returns

◆ DelayBeforeExplosionCoroutine()

virtual IEnumerator MoreMountains.TopDownEngine.ExplodudesBomb.DelayBeforeExplosionCoroutine ( )
protectedvirtual

Applies a delay before exploding the bomb

Returns

◆ Detonate()

virtual void MoreMountains.TopDownEngine.ExplodudesBomb.Detonate ( )
virtual

Detonates the bomb

◆ DetonateCoroutine()

virtual IEnumerator MoreMountains.TopDownEngine.ExplodudesBomb.DetonateCoroutine ( )
protectedvirtual

Detonates the bomb and instantiates damage areas

Returns

◆ DirectedExplosion()

virtual void MoreMountains.TopDownEngine.ExplodudesBomb.DirectedExplosion ( RaycastHit  hit,
DamageOnTouch  damageArea,
ParticleSystem  explosion,
float  angle 
)
protectedvirtual

Explodes in one of the 4 directions

Parameters
hit
damageArea
explosion
angle

◆ Initialization()

virtual void MoreMountains.TopDownEngine.ExplodudesBomb.Initialization ( )
protectedvirtual

Initializes the bomb

◆ OnEnable()

virtual void MoreMountains.TopDownEngine.ExplodudesBomb.OnEnable ( )
virtual

When the object gets spawned, we initialize it

◆ OnTriggerExit()

virtual void MoreMountains.TopDownEngine.ExplodudesBomb.OnTriggerExit ( Collider  collider)
protectedvirtual

When the owner of the bomb exits it, we make it an obstacle

Parameters
collider

◆ ResetBomb()

virtual void MoreMountains.TopDownEngine.ExplodudesBomb.ResetBomb ( )
protectedvirtual

Resets the bomb (usually after having been respawned from the pool)

Member Data Documentation

◆ _additionalDelayBeforeDestruction

WaitForSeconds MoreMountains.TopDownEngine.ExplodudesBomb._additionalDelayBeforeDestruction
protected

◆ _bombDuration

WaitForSeconds MoreMountains.TopDownEngine.ExplodudesBomb._bombDuration
protected

◆ _boxCollider

BoxCollider MoreMountains.TopDownEngine.ExplodudesBomb._boxCollider
protected

◆ _damageAreaCenter

DamageOnTouch MoreMountains.TopDownEngine.ExplodudesBomb._damageAreaCenter
protected

◆ _damageAreaEast

DamageOnTouch MoreMountains.TopDownEngine.ExplodudesBomb._damageAreaEast
protected

◆ _damageAreaNorth

DamageOnTouch MoreMountains.TopDownEngine.ExplodudesBomb._damageAreaNorth
protected

◆ _damageAreaPosition

Vector3 MoreMountains.TopDownEngine.ExplodudesBomb._damageAreaPosition
protected

◆ _damageAreaSize

Vector3 MoreMountains.TopDownEngine.ExplodudesBomb._damageAreaSize
protected

◆ _damageAreaSouth

DamageOnTouch MoreMountains.TopDownEngine.ExplodudesBomb._damageAreaSouth
protected

◆ _damageAreaWest

DamageOnTouch MoreMountains.TopDownEngine.ExplodudesBomb._damageAreaWest
protected

◆ _delayBeforeExplosionCoroutine

Coroutine MoreMountains.TopDownEngine.ExplodudesBomb._delayBeforeExplosionCoroutine
protected

◆ _exploded

bool MoreMountains.TopDownEngine.ExplodudesBomb._exploded = false
protected

◆ _explosionDuration

WaitForSeconds MoreMountains.TopDownEngine.ExplodudesBomb._explosionDuration
protected

◆ _obstacleEastDistance

float MoreMountains.TopDownEngine.ExplodudesBomb._obstacleEastDistance = 0f
protected

◆ _obstacleNorthDistance

float MoreMountains.TopDownEngine.ExplodudesBomb._obstacleNorthDistance = 0f
protected

◆ _obstacleSouthDistance

float MoreMountains.TopDownEngine.ExplodudesBomb._obstacleSouthDistance = 0f
protected

◆ _obstacleWestDistance

float MoreMountains.TopDownEngine.ExplodudesBomb._obstacleWestDistance = 0f
protected

◆ _otherBomb

ExplodudesBomb MoreMountains.TopDownEngine.ExplodudesBomb._otherBomb
protected

◆ _raycastEast

RaycastHit MoreMountains.TopDownEngine.ExplodudesBomb._raycastEast
protected

◆ _raycastNorth

RaycastHit MoreMountains.TopDownEngine.ExplodudesBomb._raycastNorth
protected

◆ _raycastSouth

RaycastHit MoreMountains.TopDownEngine.ExplodudesBomb._raycastSouth
protected

◆ _raycastWest

RaycastHit MoreMountains.TopDownEngine.ExplodudesBomb._raycastWest
protected

◆ BombAdditionalDelayBeforeDestruction

float MoreMountains.TopDownEngine.ExplodudesBomb.BombAdditionalDelayBeforeDestruction = 1.5f

a delay after the bomb has exploded and before it gets destroyed(in seconds)

◆ BombDamage

int MoreMountains.TopDownEngine.ExplodudesBomb.BombDamage = 10

the damage applied by the bomb to anything with a Health component

◆ BombDelayBeforeExplosion

float MoreMountains.TopDownEngine.ExplodudesBomb.BombDelayBeforeExplosion = 3f

the delay (in seconds) before the bomb's explosion

◆ BombDistanceInGridUnits

int MoreMountains.TopDownEngine.ExplodudesBomb.BombDistanceInGridUnits = 3

the distance the bomb affects

◆ BombExplosionActiveDuration

float MoreMountains.TopDownEngine.ExplodudesBomb.BombExplosionActiveDuration = 0.5f

the duration (in seconds) for which the bomb is active

◆ BombModel

Transform MoreMountains.TopDownEngine.ExplodudesBomb.BombModel

the model of the bomb

◆ DamageLayerMask

LayerMask MoreMountains.TopDownEngine.ExplodudesBomb.DamageLayerMask

the layers to apply damage to

◆ DirectedExplosionE

ParticleSystem MoreMountains.TopDownEngine.ExplodudesBomb.DirectedExplosionE

the particle system used for the eastbound explosion

◆ DirectedExplosionN

ParticleSystem MoreMountains.TopDownEngine.ExplodudesBomb.DirectedExplosionN

the particle system used for the northbound explosion

◆ DirectedExplosionS

ParticleSystem MoreMountains.TopDownEngine.ExplodudesBomb.DirectedExplosionS

the particle system used for the southbound explosion

◆ DirectedExplosionW

ParticleSystem MoreMountains.TopDownEngine.ExplodudesBomb.DirectedExplosionW

the particle system used for the westbound explosion

◆ ExplosionFeedbacks

MMFeedbacks MoreMountains.TopDownEngine.ExplodudesBomb.ExplosionFeedbacks

the feedbacks to play when the bomb explodes

◆ MaximumRaycastDistance

float MoreMountains.TopDownEngine.ExplodudesBomb.MaximumRaycastDistance = 50f

the max distance of the raycast (should be bigger than the grid)

◆ ObstaclesMask

LayerMask MoreMountains.TopDownEngine.ExplodudesBomb.ObstaclesMask = LayerManager.ObstaclesLayerMask

the layers to consider as obstacles to the bomb's fire

◆ Owner

GameObject MoreMountains.TopDownEngine.ExplodudesBomb.Owner

the owner of the bomb

◆ RaycastOffset

Vector3 MoreMountains.TopDownEngine.ExplodudesBomb.RaycastOffset = Vector3.zero

the offset to apply to the base of the obstacle detecting raycast

◆ SkinWidth

float MoreMountains.TopDownEngine.ExplodudesBomb.SkinWidth = 0.01f

a small offset to apply to the raycasts


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