raycasthit2d
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
raycasthit2d [2021/05/05 07:05] – Added title, and added another example andrew900460 | raycasthit2d [2025/01/15 04:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== RaycastHit2D ====== | ====== RaycastHit2D ====== | ||
- | ==== Implicit | + | ==== Casts Implicitly To a Bool ==== |
- | + | RaycastHit2D | |
- | '' | + | <code csharp> |
- | This is because C# has the ability to do implied type conversions, | + | public static implicit operator |
- | + | </ | |
- | Example: | + | ++++ Example |
- | < | + | < |
RaycastHit2D hit = Physics2D.Raycast(someStartPoint, | RaycastHit2D hit = Physics2D.Raycast(someStartPoint, | ||
Line 16: | Line 16: | ||
This is also valid: | This is also valid: | ||
- | < | + | < |
RaycastHit2D hit = Physics2D.Raycast(someStartPoint, | RaycastHit2D hit = Physics2D.Raycast(someStartPoint, | ||
bool rayHitSomthing = hit; | bool rayHitSomthing = hit; | ||
</ | </ | ||
+ | ++++ |
raycasthit2d.1620198329.txt.gz · Last modified: 2025/01/15 04:35 (external edit)