huh ?
This commit is contained in:
@@ -209,9 +209,9 @@ public abstract class Character : MonoBehaviour
|
||||
_facingRight = !_facingRight;
|
||||
}
|
||||
|
||||
static public RaycastHit2D BoxCast(Vector2 origen, Vector2 size, float angle, Vector2 direction, float distance, int mask)
|
||||
static public RaycastHit2D BoxCast(Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, int mask)
|
||||
{
|
||||
RaycastHit2D hit = Physics2D.BoxCast(origen, size, angle, direction, distance, mask);
|
||||
RaycastHit2D hit = Physics2D.BoxCast(origin, size, angle, direction, distance, mask);
|
||||
|
||||
//Setting up the points to draw the cast
|
||||
Vector2 p1, p2, p3, p4, p5, p6, p7, p8;
|
||||
@@ -228,10 +228,10 @@ public abstract class Character : MonoBehaviour
|
||||
p3 = q * p3;
|
||||
p4 = q * p4;
|
||||
|
||||
p1 += origen;
|
||||
p2 += origen;
|
||||
p3 += origen;
|
||||
p4 += origen;
|
||||
p1 += origin;
|
||||
p2 += origin;
|
||||
p3 += origin;
|
||||
p4 += origin;
|
||||
|
||||
Vector2 realDistance = direction.normalized * distance;
|
||||
p5 = p1 + realDistance;
|
||||
@@ -258,7 +258,8 @@ public abstract class Character : MonoBehaviour
|
||||
Debug.DrawLine(p4, p8, Color.grey);
|
||||
if (hit)
|
||||
{
|
||||
Debug.DrawLine(hit.point, hit.point + hit.normal.normalized * 0.2f, Color.yellow);
|
||||
var color = hit.point.x > origin.x ? Color.yellow : Color.cyan;
|
||||
Debug.DrawLine(hit.point, hit.point + hit.normal.normalized * 0.2f, color);
|
||||
}
|
||||
|
||||
return hit;
|
||||
|
||||
Reference in New Issue
Block a user