Search Results for

    Show / Hide Table of Contents

    Class HitBox

    Represents an abstract base class for hitboxes used in combat systems. Handles collision detection with hurtboxes and manages position updates.

    Inheritance
    System.Object
    HitBox
    CircleCastHitBox
    CircleHitBox
    EllipseHitBox
    FOVHitBox
    Namespace: CatchIo.Runtime.Combat.HitBoxes
    Assembly: cs.temp.dll.dll
    Syntax
    public abstract class HitBox : MonoBehaviour

    Fields

    _hitResults

    Array to store results of collision detection.

    Declaration
    protected Collider2D[] _hitResults
    Field Value
    Type Description
    Collider2D[]

    _raycastHitResults

    Declaration
    protected RaycastHit2D[] _raycastHitResults
    Field Value
    Type Description
    RaycastHit2D[]

    _targetLayerMask

    The layer mask used to filter detected objects during collision checks.

    Declaration
    protected LayerMask _targetLayerMask
    Field Value
    Type Description
    LayerMask

    _targetTag

    The tag used to filter detected objects during collision checks.

    Declaration
    protected string _targetTag
    Field Value
    Type Description
    System.String

    Properties

    ViewID

    Gets the Photon View ID associated with this hitbox.

    Declaration
    public int ViewID { get; }
    Property Value
    Type Description
    System.Int32

    Methods

    DetectHurtBox<T>(Func<T, Boolean>)

    Detects a single hurtbox of the specified type within the hitbox.

    Declaration
    public abstract T DetectHurtBox<T>(Func<T, bool> filter = null)
        where T : HurtBox
    Parameters
    Type Name Description
    System.Func<T, System.Boolean> filter

    Optional filter function to refine detection.

    Returns
    Type Description
    T

    The detected hurtbox, or null if none are found.

    Type Parameters
    Name Description
    T

    The type of the hurtbox to detect.

    DetectHurtBoxes<T>(Func<T, Boolean>)

    Detects all hurtboxes of the specified type within the hitbox.

    Declaration
    public abstract T[] DetectHurtBoxes<T>(Func<T, bool> filter = null)
        where T : HurtBox
    Parameters
    Type Name Description
    System.Func<T, System.Boolean> filter

    Optional filter function to refine detection.

    Returns
    Type Description
    T[]

    An array of detected hurtboxes, or null if none are found.

    Type Parameters
    Name Description
    T

    The type of the hurtboxes to detect.

    HasTag()

    Checks if the target tag is defined.

    Declaration
    protected bool HasTag()
    Returns
    Type Description
    System.Boolean

    True if a target tag is defined; otherwise, false.

    UpdatePosition(EntityDirectionType)

    Updates the hitbox position based on the specified direction type.

    Declaration
    public void UpdatePosition(EntityDirectionType directionType)
    Parameters
    Type Name Description
    EntityDirectionType directionType

    The direction type to move the hitbox.

    UpdatePosition(Vector2)

    Updates the hitbox position based on a custom direction vector.

    Declaration
    public void UpdatePosition(Vector2 directionVector)
    Parameters
    Type Name Description
    Vector2 directionVector

    The custom direction vector.

    UpdateViewID(Int32)

    Updates the Photon View ID of the hitbox.

    Declaration
    public void UpdateViewID(int newViewID)
    Parameters
    Type Name Description
    System.Int32 newViewID

    The new Photon View ID.

    In This Article
    Back to top ©Team STEP, All Rights Reserved.