Skip to content

Commit

Permalink
feat(Cast): make drag curve offset a vector3
Browse files Browse the repository at this point in the history
The Drag Curve Offset is now a Vector3 allowing the curve offset to
be applied to any axis rather than just the back axis.

To replicate the orignal setting, just change the Z axis to a negative
value and this will replicate the same as the Vector3.back * offset.
  • Loading branch information
thestonefox committed Apr 17, 2024
1 parent 3238142 commit f90f1e8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Runtime/Cast/StraightLineCast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ public int DragEffectDensity
}
}
}
[Tooltip("The amount of height offset to apply to the curved drag line.")]
[Tooltip("The amount of offset to apply to the curved drag line.")]
[SerializeField]
private float dragCurveOffset;
private Vector3 dragCurveOffset;
/// <summary>
/// The amount of height offset to apply to the curved drag line.
/// The amount of offset to apply to the curved drag line.
/// </summary>
public float DragCurveOffset
public Vector3 DragCurveOffset
{
get
{
Expand Down Expand Up @@ -321,7 +321,7 @@ protected virtual void GeneratePoints(Vector3 originPoint, Vector3 midPoint, Vec
{
curvePoints.Clear();
curvePoints.Add(originPoint);
curvePoints.Add(midPoint + (Vector3.back * DragCurveOffset));
curvePoints.Add(midPoint + DragCurveOffset);
curvePoints.Add(destinationPoint);
curvePoints.Add(destinationPoint);

Expand Down

0 comments on commit f90f1e8

Please sign in to comment.