Super Bomber Kit
Search Results for

    Show / Hide Table of Contents

    Class BasicEnemy

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    BasicEnemy
    Implements
    IEnemy
    IDamageTaker
    IDamageEmitter
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StartCoroutine_Auto(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: BomberDogs.Enemies
    Assembly: Assembly-CSharp.dll
    Syntax
    public class BasicEnemy : MonoBehaviour, IEnemy, IDamageTaker, IDamageEmitter

    Fields

    | Edit this page View Source

    Animator

    Animator for animation control

    Declaration
    [Header("Components")]
    public Animator Animator
    Field Value
    Type Description
    Animator
    | Edit this page View Source

    AttackCollider

    Specifies the collider that will emit damage when it comes into contact with the enemy.

    Declaration
    [Tooltip("Specifies the collider that will emit damage when it comes into contact with the enemy.")]
    public Collider2D AttackCollider
    Field Value
    Type Description
    Collider2D
    | Edit this page View Source

    BodyCircleCollider

    Collider responsible for collisions with walls, blocks, and bombs.

    Declaration
    [Tooltip("Body Collider responsible for collisions with walls, blocks, and bombs.")]
    public CircleCollider2D BodyCircleCollider
    Field Value
    Type Description
    CircleCollider2D
    | Edit this page View Source

    CanLookBack

    Specifies whether the enemy can see behind and flip towards the player's direction.

    Declaration
    [Tooltip("Specifies whether the enemy can see behind and flip towards the player's direction.")]
    public bool CanLookBack
    Field Value
    Type Description
    bool
    | Edit this page View Source

    CharacterRigidBody

    Character ridbody that collides in scenary walls and objects

    Declaration
    public Rigidbody2D CharacterRigidBody
    Field Value
    Type Description
    Rigidbody2D
    | Edit this page View Source

    DamageBlinkDuration

    Damage blink duration

    Declaration
    [Tooltip("Damage blink duration")]
    public float DamageBlinkDuration
    Field Value
    Type Description
    float
    | Edit this page View Source

    DamageValue

    Damage value inflicted on anyone that this enemy touches.

    Declaration
    [Tooltip("Damage value inflicted on anyone that this enemy touches.")]
    public int DamageValue
    Field Value
    Type Description
    int
    | Edit this page View Source

    DeathSfx

    Sound effect when this enemy dies.

    Declaration
    [Header("Sfx")]
    [Tooltip("Sound effect when this enemy dies.")]
    public AudioClipSpec DeathSfx
    Field Value
    Type Description
    AudioClipSpec
    | Edit this page View Source

    DebugAnimatorCrossFades

    Turns on animator crossfade debug

    Declaration
    [Tooltip("Turns on animator crossfade debug.")]
    public bool DebugAnimatorCrossFades
    Field Value
    Type Description
    bool
    | Edit this page View Source

    EggPrefab

    If this enemy drops an egg upon death, specify it here; otherwise, leave it null.

    Declaration
    [Tooltip("If this enemy drops an egg upon death, specify it here; otherwise, leave it null.")]
    public GameObject EggPrefab
    Field Value
    Type Description
    GameObject
    | Edit this page View Source

    ForgetPlayerPositionWhenSeeingTheBomb

    Specifies that the enemy will not use player evasion detection if there is a bomb in the way.

    Declaration
    [Tooltip("Specifies that the enemy will not use player evasion detection if there is a bomb in the way.")]
    public bool ForgetPlayerPositionWhenSeeingTheBomb
    Field Value
    Type Description
    bool
    | Edit this page View Source

    GenericDeathEffectPrefab

    Prefab for generic death effect

    Declaration
    [Header("Prefabs")]
    public GameObject GenericDeathEffectPrefab
    Field Value
    Type Description
    GameObject
    | Edit this page View Source

    Health

    Health

    Declaration
    [Tooltip("Health")]
    public int Health
    Field Value
    Type Description
    int
    | Edit this page View Source

    HittableLayer

    Specifies the layer that is hittable.

    Declaration
    [Header("Attack")]
    [Tooltip("Specifies the layer that is hittable.")]
    public LayerMask HittableLayer
    Field Value
    Type Description
    LayerMask
    | Edit this page View Source

    IdleToDownState

    Animation state to cross fade to idle down animation

    Declaration
    [AnimatorStatesDropdown(0)]
    public string IdleToDownState
    Field Value
    Type Description
    string
    | Edit this page View Source

    IdleToRightState

    Animation state to cross fade to idle right animation

    Declaration
    [AnimatorStatesDropdown(0)]
    public string IdleToRightState
    Field Value
    Type Description
    string
    | Edit this page View Source

    IdleToUpState

    Animation state to cross fade to idle up animation

    Declaration
    [AnimatorStatesDropdown(0)]
    public string IdleToUpState
    Field Value
    Type Description
    string
    | Edit this page View Source

    PlayerDetectionDistance

    The distance at which the enemy is able to see the player

    Declaration
    [Range(0, 100)]
    [Tooltip("The distance at which the enemy is able to see the player.")]
    public float PlayerDetectionDistance
    Field Value
    Type Description
    float
    | Edit this page View Source

    ProbabilityToFlipOnIntersection

    Smarter enemies turn at intersections, while the dumber ones go straight through. Select 100 for the first and zero for the second. Use a midpoint for the middle term

    Declaration
    [Header("Walk Cycle Tweaks")]
    [Range(0, 100)]
    [Tooltip("Smarter enemies turn at intersections, while the dumber ones go straight through. Select 100 for the first and zero for the second. Use a midpoint for the middle term.")]
    public float ProbabilityToFlipOnIntersection
    Field Value
    Type Description
    float
    | Edit this page View Source

    ProbabilityToFollowPlayer

    Smarter enemies follow the player, while the dumber ones ignore them and continue straight. Use 100 for the first, 0 for the second, and a midpoint for the middle term.

    Declaration
    [Range(0, 100)]
    [Tooltip("Smarter enemies follow the player, while the dumber ones ignore them and continue straight. Use 100 for the first, 0 for the second, and a midpoint for the middle term.")]
    public float ProbabilityToFollowPlayer
    Field Value
    Type Description
    float
    | Edit this page View Source

    ScorePoints

    Points that the player earns when this enemy dies.

    Declaration
    [Tooltip("Points that the player earns when this enemy dies.")]
    public int ScorePoints
    Field Value
    Type Description
    int
    | Edit this page View Source

    SpriteRenderer

    The sprite renderer reference necessary to perform direction flips.

    Declaration
    [Tooltip("The sprite renderer necessary to perform direction flips.")]
    public SpriteRenderer SpriteRenderer
    Field Value
    Type Description
    SpriteRenderer
    | Edit this page View Source

    TimeToRememberPlayerPosition

    Time in which the enemy is able to remember the player's position after losing sight of them.

    Declaration
    [Range(0, 100)]
    [Tooltip("Time in which the enemy is able to remember the player's position after losing sight of them.")]
    public float TimeToRememberPlayerPosition
    Field Value
    Type Description
    float
    | Edit this page View Source

    WaitBeforeChangeDirection

    Time to wait before changing to another direction

    Declaration
    [Tooltip("Time to wait before changing to another direction.")]
    public float WaitBeforeChangeDirection
    Field Value
    Type Description
    float
    | Edit this page View Source

    WalkSpeed

    Walk speed.

    Declaration
    [Tooltip("Walk speed.")]
    public float WalkSpeed
    Field Value
    Type Description
    float
    | Edit this page View Source

    WalkingToDownState

    Animation state to cross fade to walking down animation

    Declaration
    [AnimatorStatesDropdown(0)]
    public string WalkingToDownState
    Field Value
    Type Description
    string
    | Edit this page View Source

    WalkingToRightState

    Animation state to cross fade to walking right animation

    Declaration
    [Header("Animator States")]
    [AnimatorStatesDropdown(0)]
    public string WalkingToRightState
    Field Value
    Type Description
    string
    | Edit this page View Source

    WalkingToUpState

    Animation state to cross fade to walking up animation

    Declaration
    [AnimatorStatesDropdown(0)]
    public string WalkingToUpState
    Field Value
    Type Description
    string
    | Edit this page View Source

    _lastAnimatorState

    Declaration
    protected string _lastAnimatorState
    Field Value
    Type Description
    string
    | Edit this page View Source

    currentDirection

    Direction where this character is walking

    Declaration
    protected Vector2 currentDirection
    Field Value
    Type Description
    Vector2
    | Edit this page View Source

    dead

    Indicates that this enemy has already been killed

    Declaration
    protected bool dead
    Field Value
    Type Description
    bool
    | Edit this page View Source

    flipSpriteHorizontally

    If your sprite is inverted, use this.

    Declaration
    [Header("General Tweaks")]
    [Tooltip("If your sprite is inverted, use this.")]
    public bool flipSpriteHorizontally
    Field Value
    Type Description
    bool
    | Edit this page View Source

    impassableLayerMask

    Layermask corresponding to objects that cannot be passed through.

    Declaration
    protected LayerMask impassableLayerMask
    Field Value
    Type Description
    LayerMask
    | Edit this page View Source

    lastSeenPlayer

    Last seen player

    Declaration
    [SerializeField]
    protected GameObject lastSeenPlayer
    Field Value
    Type Description
    GameObject
    | Edit this page View Source

    lastSeenPlayerPosition

    Last position the player was seen at

    Declaration
    [Header("Debug")]
    [SerializeField]
    protected Vector2? lastSeenPlayerPosition
    Field Value
    Type Description
    Vector2?
    | Edit this page View Source

    playerEvasionDirection

    Direction in which the player evaded

    Declaration
    [SerializeField]
    protected Vector2? playerEvasionDirection
    Field Value
    Type Description
    Vector2?

    Methods

    | Edit this page View Source

    Die(IDamageEmitter)

    Handle dying process

    Declaration
    public void Die(IDamageEmitter emitter)
    Parameters
    Type Name Description
    IDamageEmitter emitter

    killer

    | Edit this page View Source

    Freeze(float)

    Freezes this enemy. It is called when the player gets the time powerup

    Declaration
    public void Freeze(float duration)
    Parameters
    Type Name Description
    float duration
    | Edit this page View Source

    FreezeAllActiveEnemies(float)

    Freeze all enemies in the scene

    Declaration
    public static void FreezeAllActiveEnemies(float duration)
    Parameters
    Type Name Description
    float duration
    | Edit this page View Source

    GetEmitter()

    Method to catch the emitter. This exists because sometimes another object is responsible for the damage.

    Declaration
    public MonoBehaviour GetEmitter()
    Returns
    Type Description
    MonoBehaviour
    | Edit this page View Source

    GetScorePointsForDeath()

    Get how many points this enemy is worth

    Declaration
    public int GetScorePointsForDeath()
    Returns
    Type Description
    int
    | Edit this page View Source

    TakeDamage(DamageEmissionDto)

    Takes damage and executes the blink process.

    Declaration
    public DamageResponseDto TakeDamage(DamageEmissionDto emission)
    Parameters
    Type Name Description
    DamageEmissionDto emission
    Returns
    Type Description
    DamageResponseDto
    | Edit this page View Source

    WalkCycle()

    Walk cycle coroutine

    Declaration
    protected virtual IEnumerator WalkCycle()
    Returns
    Type Description
    IEnumerator

    Events

    | Edit this page View Source

    onDie

    Event triggered when the enemy dies. This is used by the level manager for enemy counting.

    Declaration
    public event Action<BasicEnemy, IDamageEmitter> onDie
    Event Type
    Type Description
    Action<BasicEnemy, IDamageEmitter>

    Implements

    IEnemy
    IDamageTaker
    IDamageEmitter

    Extension Methods

    MonoBehaviourExtensions.DelayedCall(MonoBehaviour, Action, float)
    MonoBehaviourExtensions.DelayedCallUnscaled(MonoBehaviour, Action, float)
    MonoBehaviourExtensions.LoopForAWile(MonoBehaviour, Action<float>, float, Action, bool)
    MonoBehaviourExtensions.LoopWhileReturnTrue(MonoBehaviour, Func<bool>, Action, bool)
    • Edit this page
    • View Source
    In this article
    Back to top