Struct Sprite2DRendererHitBox2D
Describes a 2D hit box for simple picking.
Namespace: Unity.Tiny.HitBox2D
Syntax
public struct Sprite2DRendererHitBox2D : IComponentData
Remarks
This component behaves the same as a HitBox2D component, but a Sprite2DRenderer component defines its size.
Fields
pixelAccurate
When true, the Sprite2DRendererHitBox2D component uses pixel-accurate hit testing from the sprite. Defaults to false.
Declaration
public bool pixelAccurate
Field Value
Type | Description |
---|---|
System.Boolean |
Remarks
Pixel-accurate hit testing requires that the entity have both an Image2D component and an Image2DAlphaMask component attached before image loading. It ignores hits and overlap where the sprite Alpha is zero. Note that pixel-accurate hit testing is computationally intensive.