This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
raycasthit2d [2021/05/05 07:11] andrew900460 added syntax coloring for examples |
raycasthit2d [2021/05/05 16:53] uninomiconadmin |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== RaycastHit2D ====== | ====== RaycastHit2D ====== | ||
- | ==== Implicit | + | ==== Casts Implicitly To a Bool ==== |
- | '' | + | RaycastHit2D |
- | This is because C# has the ability to do implied type conversions, | + | |
- | Example: | + | ++++ Example: |
<code c#> | <code c#> | ||
RaycastHit2D hit = Physics2D.Raycast(someStartPoint, | RaycastHit2D hit = Physics2D.Raycast(someStartPoint, | ||
Line 21: | Line 20: | ||
bool rayHitSomthing = hit; | bool rayHitSomthing = hit; | ||
</ | </ | ||
+ | ++++ |