raycasthit2d
This is an old revision of the document!
RaycastHit2D
Casts Implicitly To a Bool
RaycastHit2D implements the C# implicit bool operator. This allows it to be used in an if statement to check whether a hit is found.
public static implicit operator bool(RaycastHit2D hit) => (Object) hit.collider != (Object) null;
raycasthit2d.1620233879.txt.gz · Last modified: 2025/01/15 04:35 (external edit)