Class Egg
Component for the eggs from which mountables hatch.
Implements
Inherited Members
Namespace: BomberDogs.Level
Assembly: Assembly-CSharp.dll
Syntax
public class Egg : MonoBehaviour, IDamageTaker
Fields
| Edit this page View SourceDestructionEffectPrefab
Prefab for destruction effect.
Declaration
[Tooltip("Prefab for destruction effect")]
public GameObject DestructionEffectPrefab
Field Value
| Type | Description |
|---|---|
| GameObject |
EggAnimator
Animator component
Declaration
public Animator EggAnimator
Field Value
| Type | Description |
|---|---|
| Animator |
EggCollider
Egg collider.
Declaration
public Collider2D EggCollider
Field Value
| Type | Description |
|---|---|
| Collider2D |
EggSpriteRenderer
Egg sprite renderer
Declaration
public SpriteRenderer EggSpriteRenderer
Field Value
| Type | Description |
|---|---|
| SpriteRenderer |
FlipX
If the sprite renderer is flipped use this to invert horizontal direction
Declaration
public bool FlipX
Field Value
| Type | Description |
|---|---|
| bool |
HitboxCollider
hitbox collider
Declaration
public Collider2D HitboxCollider
Field Value
| Type | Description |
|---|---|
| Collider2D |
IdleAnimatorState
Animator state for Idle animation
Declaration
[AnimatorStatesDropdown(0)]
public string IdleAnimatorState
Field Value
| Type | Description |
|---|---|
| string |
OnTrailDownAnimatorState
Animator state for trail down animation
Declaration
[AnimatorStatesDropdown(0)]
public string OnTrailDownAnimatorState
Field Value
| Type | Description |
|---|---|
| string |
OnTrailRightAnimatorState
Animator state for trail right animation
Declaration
[AnimatorStatesDropdown(0)]
public string OnTrailRightAnimatorState
Field Value
| Type | Description |
|---|---|
| string |
OnTrailUpAnimatorState
Animator state for trail up animation
Declaration
[AnimatorStatesDropdown(0)]
public string OnTrailUpAnimatorState
Field Value
| Type | Description |
|---|---|
| string |
RidableAnimalGameObject
Animal that will hatch from the egg. Must be a MountableBehaviourCore
Declaration
[Tooltip("Animal that will hatch from the egg. Must be a MountableBehaviourCore")]
public MountableBehaviourCore RidableAnimalGameObject
Field Value
| Type | Description |
|---|---|
| MountableBehaviourCore |
RidableInstantiationDelay
Delay to instantiate ridabble. This is for animation timing purposes.
Declaration
[Tooltip("Delay to instantiate ridabble. This is for animation timing purposes.")]
public float RidableInstantiationDelay
Field Value
| Type | Description |
|---|---|
| float |
Properties
| Edit this page View SourceDying
If the egg is already dying. This is necessary so that it does not trigger the dying animation or event twice.
Declaration
public bool Dying { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
| Edit this page View SourceAddImunityTo(IDamageEmitter)
Triggers immunity when the egg is instantiated. This is necessary because the egg spawns in contact with fire, so it needs immunity to that fire.
Declaration
public void AddImunityTo(IDamageEmitter emitter)
Parameters
| Type | Name | Description |
|---|---|---|
| IDamageEmitter | emitter |
BornNow(Action<GameObject>)
Create mountable animal and interacts with MountableBehaviourCore to perform the mounting process.
Declaration
public void BornNow(Action<GameObject> callback)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<GameObject> | callback | Call after animal be created |
SetToTrailMode(bool)
When the egg enters the player's trail, it can no longer be collected by the player itself.
Declaration
public void SetToTrailMode(bool on)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | on |
TakeDamage(DamageEmissionDto)
If it takes damage, it will be destroyed unless it is already in the process of hatching.
Declaration
public DamageResponseDto TakeDamage(DamageEmissionDto emission)
Parameters
| Type | Name | Description |
|---|---|---|
| DamageEmissionDto | emission |
Returns
| Type | Description |
|---|---|
| DamageResponseDto |
cleanupOnDieEvent()
Cleanup ondie event
Declaration
public void cleanupOnDieEvent()
Events
| Edit this page View SourceonCollideWithAnotherEgg
This triggers the Egg Trail Behavior component to cut off a chain of eggs if one in the middle dies.
Declaration
public event Action<Egg> onCollideWithAnotherEgg
Event Type
| Type | Description |
|---|---|
| Action<Egg> |
onDies
Event when the egg dies.
Declaration
public event Action<Egg> onDies
Event Type
| Type | Description |
|---|---|
| Action<Egg> |