private RaycastHit2D CastLeftSearchingRay() { float lerpAngleLeft = Mathf.LerpAngle(vecLeftUp_Angle, vecLeftDown_Angle, t); Vector2 lerpVectorLeft = StaticUtilities.Vector2FromAngle(lerpAngleLeft); Debug.DrawRay(transform.position, lerpVectorLeft * searchRange, Color.magenta, .01f); return(Physics2D.Raycast(transform.position, lerpVectorLeft, searchRange, targetLayerMask)); }
private void SetUpSearchBoundaries() { Vector2 vecLeftUp = StaticUtilities.Vector2FromAngle(vecLeftUp_Angle); // Debug.DrawRay(transform.position, vecLeftUp, Color.red, .5f); Vector2 vecLeftDown = StaticUtilities.Vector2FromAngle(vecLeftDown_Angle); // Debug.DrawRay(transform.position, vecLeftDown, Color.red, .5f); Vector2 vecRightUp = StaticUtilities.Vector2FromAngle(vecRightUp_Angle); // Debug.DrawRay(transform.position, vecRightUp, Color.red, .5f); Vector2 vecRightDown = StaticUtilities.Vector2FromAngle(vecRightDown_Angle); // Debug.DrawRay(transform.position, vecRightDown, Color.red, .5f); }