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

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

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

Public Types

enum  DamageAreaShapes { DamageAreaShapes.Rectangle, DamageAreaShapes.Circle }
 the shape of the bomb's damage area More...
 

Public Attributes

float TimeBeforeExplosion = 2f
 the delay before the bomb explodes More...
 
GameObject ExplosionEffect
 a vfx to instantiate when the bomb explodes More...
 
AudioClip ExplosionSfx
 a sound to play when the bomb explodes More...
 
bool FlickerSprite = true
 whether or not the sprite should flicker before explosion More...
 
float TimeBeforeFlicker = 1f
 the duration before the flicker starts More...
 
string MaterialPropertyName = "_Color"
 the name of the property that should flicker More...
 
Collider2D DamageAreaCollider
 the collider of the damage area More...
 
float DamageAreaActiveDuration = 1f
 the duration of the damage area More...
 

Protected Member Functions

virtual void OnEnable ()
 On enable, we initialize our bomb More...
 
virtual void Initialization ()
 Initializes the bomb More...
 
virtual void Update ()
 On update, makes our bomb flicker, activates the damage area and destroys the bomb if needed More...
 
virtual void DestroyBomb ()
 Destroys the bomb More...
 
virtual void InstantiateExplosionEffect ()
 Instantiates a VFX at the bomb's position More...
 
virtual void PlayExplosionSound ()
 Plays a sound on explosion More...
 
virtual void EnableDamageArea ()
 Enables the damage area. More...
 
virtual void DisableDamageArea ()
 Disables the damage area. More...
 

Protected Attributes

float _timeSinceStart
 
Renderer _renderer
 
MMPoolableObject _poolableObject
 
bool _flickering
 
bool _damageAreaActive
 
Color _initialColor
 
Color _flickerColor = new Color32(255, 20, 20, 255)
 
MaterialPropertyBlock _propertyBlock
 

Detailed Description

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

Member Enumeration Documentation

◆ DamageAreaShapes

the shape of the bomb's damage area

Enumerator
Rectangle 
Circle 

Member Function Documentation

◆ DestroyBomb()

virtual void MoreMountains.TopDownEngine.Bomb.DestroyBomb ( )
protectedvirtual

Destroys the bomb

◆ DisableDamageArea()

virtual void MoreMountains.TopDownEngine.Bomb.DisableDamageArea ( )
protectedvirtual

Disables the damage area.

◆ EnableDamageArea()

virtual void MoreMountains.TopDownEngine.Bomb.EnableDamageArea ( )
protectedvirtual

Enables the damage area.

◆ Initialization()

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

Initializes the bomb

◆ InstantiateExplosionEffect()

virtual void MoreMountains.TopDownEngine.Bomb.InstantiateExplosionEffect ( )
protectedvirtual

Instantiates a VFX at the bomb's position

◆ OnEnable()

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

On enable, we initialize our bomb

◆ PlayExplosionSound()

virtual void MoreMountains.TopDownEngine.Bomb.PlayExplosionSound ( )
protectedvirtual

Plays a sound on explosion

◆ Update()

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

On update, makes our bomb flicker, activates the damage area and destroys the bomb if needed

Member Data Documentation

◆ _damageAreaActive

bool MoreMountains.TopDownEngine.Bomb._damageAreaActive
protected

◆ _flickerColor

Color MoreMountains.TopDownEngine.Bomb._flickerColor = new Color32(255, 20, 20, 255)
protected

◆ _flickering

bool MoreMountains.TopDownEngine.Bomb._flickering
protected

◆ _initialColor

Color MoreMountains.TopDownEngine.Bomb._initialColor
protected

◆ _poolableObject

MMPoolableObject MoreMountains.TopDownEngine.Bomb._poolableObject
protected

◆ _propertyBlock

MaterialPropertyBlock MoreMountains.TopDownEngine.Bomb._propertyBlock
protected

◆ _renderer

Renderer MoreMountains.TopDownEngine.Bomb._renderer
protected

◆ _timeSinceStart

float MoreMountains.TopDownEngine.Bomb._timeSinceStart
protected

◆ DamageAreaActiveDuration

float MoreMountains.TopDownEngine.Bomb.DamageAreaActiveDuration = 1f

the duration of the damage area

◆ DamageAreaCollider

Collider2D MoreMountains.TopDownEngine.Bomb.DamageAreaCollider

the collider of the damage area

◆ ExplosionEffect

GameObject MoreMountains.TopDownEngine.Bomb.ExplosionEffect

a vfx to instantiate when the bomb explodes

◆ ExplosionSfx

AudioClip MoreMountains.TopDownEngine.Bomb.ExplosionSfx

a sound to play when the bomb explodes

◆ FlickerSprite

bool MoreMountains.TopDownEngine.Bomb.FlickerSprite = true

whether or not the sprite should flicker before explosion

◆ MaterialPropertyName

string MoreMountains.TopDownEngine.Bomb.MaterialPropertyName = "_Color"

the name of the property that should flicker

◆ TimeBeforeExplosion

float MoreMountains.TopDownEngine.Bomb.TimeBeforeExplosion = 2f

the delay before the bomb explodes

◆ TimeBeforeFlicker

float MoreMountains.TopDownEngine.Bomb.TimeBeforeFlicker = 1f

the duration before the flicker starts


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