Class HitBox2DSystem | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class HitBox2DSystem

    This system tests for overlaps between all components under all cameras in the world.

    Inheritance
    System.Object
    HitBox2DSystem
    Namespace: Unity.Tiny.HitBox2D
    Syntax
    public class HitBox2DSystem : ComponentSystem
    Remarks

    It adds HitBoxOverlapResults components to entities that overlap others, and removes them from entities that no longer overlap others.

    Overlaps are only detected between objects that overlap under the same camera.

    Fields

    cppWrapper

    Declaration
    protected IntPtr cppWrapper
    Field Value
    Type Description
    System.IntPtr

    Methods

    DeinitNative()

    Declaration
    protected static void DeinitNative()

    DetailedHitBoxOverlapInformation(Entity, HitBoxOverlap, Allocator)

    Returns a 2D convex polygon outline of the intersection between two hit boxes. This can be rendered as a Shape2D component.

    Declaration
    public NativeArray<float2> DetailedHitBoxOverlapInformation(Entity e, HitBoxOverlap overlap, Allocator allocator = null)
    Parameters
    Type Name Description
    Entity e
    HitBoxOverlap overlap
    Allocator allocator
    Returns
    Type Description
    NativeArray<float2>

    DetailedOverlapInformationNative(IntPtr, Entity, HitBoxOverlap, float2*)

    Declaration
    protected static int DetailedOverlapInformationNative(IntPtr emr, Entity e, HitBoxOverlap overlap, float2*result)
    Parameters
    Type Name Description
    System.IntPtr emr
    Entity e
    HitBoxOverlap overlap
    float2* result
    Returns
    Type Description
    System.Int32

    GetSweepResultsNative(Entity**, HitBoxOverlap**)

    Declaration
    protected static int GetSweepResultsNative(Entity**e, HitBoxOverlap**outPtr)
    Parameters
    Type Name Description
    Entity** e
    HitBoxOverlap** outPtr
    Returns
    Type Description
    System.Int32

    HitTest(float3, Entity)

    Find the entity under hitPoint for the given camera.

    Declaration
    public HitTestResult HitTest(float3 hitPoint, Entity camera)
    Parameters
    Type Name Description
    float3 hitPoint
    Entity camera
    Returns
    Type Description
    HitTestResult

    HitTestCamera(float3)

    Return an Entity that has a DisplayListCamera that contains point hitPoint, or Null if none matches.

    Declaration
    public Entity HitTestCamera(float3 hitPoint)
    Parameters
    Type Name Description
    float3 hitPoint
    Returns
    Type Description
    Entity

    HitTestNative(IntPtr, float3, Entity, ref HitTestResult)

    Declaration
    protected static void HitTestNative(IntPtr emr, float3 hitPoint, Entity camera, ref HitTestResult result)
    Parameters
    Type Name Description
    System.IntPtr emr
    float3 hitPoint
    Entity camera
    HitTestResult result

    InitNative()

    Declaration
    protected static void InitNative()

    OnCreate()

    Declaration
    protected override void OnCreate()

    OnDestroy()

    Declaration
    protected override void OnDestroy()

    OnUpdate()

    Declaration
    protected override void OnUpdate()

    RayCast(float3, float3, Entity)

    Declaration
    public RayCastResult RayCast(float3 startPoint, float3 endPoint, Entity camera)
    Parameters
    Type Name Description
    float3 startPoint
    float3 endPoint
    Entity camera
    Returns
    Type Description
    RayCastResult

    RayCastNative(IntPtr, float3, float3, Entity, ref RayCastResult)

    Declaration
    protected static void RayCastNative(IntPtr emr, float3 startPoint, float3 endPoint, Entity camera, ref RayCastResult result)
    Parameters
    Type Name Description
    System.IntPtr emr
    float3 startPoint
    float3 endPoint
    Entity camera
    RayCastResult result

    SweepLineNative(IntPtr, Entity, Camera2D)

    Declaration
    protected static void SweepLineNative(IntPtr emr, Entity e, Camera2D cam)
    Parameters
    Type Name Description
    System.IntPtr emr
    Entity e
    Camera2D cam
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023