UnityPlatformer.RaycastController.ForeachRightRay C# (CSharp) Method

ForeachRightRay() public method

Iterate over all right/horizontal rays
public ForeachRightRay ( float rayLength, Vector3 &velocity, RayItr itr ) : void
rayLength float
velocity Vector3
itr RayItr
return void
    public void ForeachRightRay(float rayLength, ref Vector3 velocity, RayItr itr) {
      if (velocity.x > 0) {
        rayLength += velocity.x;
      }

      Vector3 origin = raycastOrigins.bottomRight;
      origin.y += velocity.y;

      for (int i = 0; i < horizontalRayCount; i ++) {

        horizontalRays[i] = Raycast(origin, Vector2.right, rayLength, collisionMask, new Color(1, 0, 0, 0.5f));
        origin.y += horizontalRaySpacing;

        itr(ref horizontalRays[i], ref velocity, 1, i);
      }
    }
    /// <summary>