Class Explosion
Script responsible for the explosion object. It will determine the size of each explosion arm based on the collision with the walls. It will also emit damage to the hit objects by calling the TakeDamage method.
Implements
Inherited Members
Namespace: BomberDogs.Level
Assembly: Assembly-CSharp.dll
Syntax
public class Explosion : MonoBehaviour, IDamageEmitter
Fields
| Edit this page View SourceAnimator
The animator, needed to get the duration of the explosion loop
Declaration
[Tooltip("The animator, needed to get the duration of the explosion loop")]
public Animator Animator
Field Value
| Type | Description |
|---|---|
| Animator |
AutoExplode
Explode on start level. Just for test purpose
Declaration
[Tooltip("Explode on start level. Just for test purpose")]
public bool AutoExplode
Field Value
| Type | Description |
|---|---|
| bool |
CameraShakeIntensity
Explosion camera shake intensity
Declaration
[Tooltip("Explosion camera shake intensity")]
public float CameraShakeIntensity
Field Value
| Type | Description |
|---|---|
| float |
CapDownObject
Tip of the lower arm of the explosion
Declaration
[Tooltip("Tip of the lower arm of the explosion")]
public GameObject CapDownObject
Field Value
| Type | Description |
|---|---|
| GameObject |
CapLeftObject
Tip of the left arm of the explosion
Declaration
[Tooltip("Tip of the left arm of the explosion")]
public GameObject CapLeftObject
Field Value
| Type | Description |
|---|---|
| GameObject |
CapRightObject
Tip of the right arm of the explosion
Declaration
[Tooltip("Tip of the right arm of the explosion")]
public GameObject CapRightObject
Field Value
| Type | Description |
|---|---|
| GameObject |
CapUpObject
Tip of the upper arm of the explosion
Declaration
[Tooltip("Tip of the upper arm of the explosion")]
public GameObject CapUpObject
Field Value
| Type | Description |
|---|---|
| GameObject |
CenterObject
Object at the center of the explosion that connects all the arms.
Declaration
[Tooltip("Object at the center of the explosion that connects all the arms.")]
public GameObject CenterObject
Field Value
| Type | Description |
|---|---|
| GameObject |
ColliderWidth
Eplosion Arm Collider Thickness. 0.5 is a good value so that damage is only done when the character collides with the center of the explosion.
Declaration
[Tooltip("Eplosion Arm Collider Thickness. 0.5 is a good value so that damage is only done when the character collides with the center of the explosion.")]
public float ColliderWidth
Field Value
| Type | Description |
|---|---|
| float |
Damage
Damage value
Declaration
public float Damage
Field Value
| Type | Description |
|---|---|
| float |
ExplosionSfx
Explosion sfx
Declaration
[Tooltip("Explosion sfx")]
public AudioClipSpec ExplosionSfx
Field Value
| Type | Description |
|---|---|
| AudioClipSpec |
ExplosionSize
Size of each explosion arm. This value will be replaced by the value sent by the bomb that issued it. But you can set this value here just for testing purposes.
Declaration
[Tooltip("Size of each explosion arm. This value will be replaced by the value sent by the bomb that issued it. But you can set this value here just for testing purposes.")]
public int ExplosionSize
Field Value
| Type | Description |
|---|---|
| int |
MaxLoopCounts
Number of animation loops to destroy this object
Declaration
[Tooltip("Number of animation loops to destroy this object")]
public int MaxLoopCounts
Field Value
| Type | Description |
|---|---|
| int |
SegmentDownObject
Lower arm object of the explosion
Declaration
[Tooltip("Lower arm object of the explosion")]
public GameObject SegmentDownObject
Field Value
| Type | Description |
|---|---|
| GameObject |
SegmentLeftObject
Left arm object of the explosion
Declaration
[Tooltip("Left arm object of the explosion")]
public GameObject SegmentLeftObject
Field Value
| Type | Description |
|---|---|
| GameObject |
SegmentRightObject
Right arm object of the explosion
Declaration
[Tooltip("Right arm object of the explosion")]
public GameObject SegmentRightObject
Field Value
| Type | Description |
|---|---|
| GameObject |
SegmentUpObject
Upper arm object of the explosion
Declaration
[Tooltip("Upper arm object of the explosion")]
public GameObject SegmentUpObject
Field Value
| Type | Description |
|---|---|
| GameObject |
Methods
| Edit this page View SourceConfigureExplosionAndInitiate(MonoBehaviour, int, bool)
Configures and Initializes the explosion, this should be called at the time the bomb instantiates this object.
Declaration
public void ConfigureExplosionAndInitiate(MonoBehaviour emitter, int explosionSize, bool pierce)
Parameters
| Type | Name | Description |
|---|---|---|
| MonoBehaviour | emitter | The one who emitted the explosion, for example the player |
| int | explosionSize | Maximum size of explosion if it does not collide with walls |
| bool | pierce | Specifies whether the explosion passes through breakable blocks. |
GetEmitter()
Get the responsible for the explosion
Declaration
public MonoBehaviour GetEmitter()
Returns
| Type | Description |
|---|---|
| MonoBehaviour |
Start()
Declaration
public void Start()
Update()
Declaration
public void Update()