This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
raycasthit2d [2021/05/05 16:53] uninomiconadmin |
raycasthit2d [2021/05/05 16:57] (current) uninomiconadmin |
||
---|---|---|---|
Line 3: | Line 3: | ||
==== Casts Implicitly To a Bool ==== | ==== Casts Implicitly To a Bool ==== | ||
RaycastHit2D implements the C# [[https:// | RaycastHit2D implements the C# [[https:// | ||
+ | <code csharp> | ||
+ | public static implicit operator bool(RaycastHit2D hit) => (Object) hit.collider != (Object) null; | ||
+ | </ | ||
++++ Example | | ++++ Example | | ||
<code c#> | <code c#> |