Skip to content

Commit 0a390e7

Browse files
committed
feat(Util): Make Ground vector accept y axis
1 parent 561cf64 commit 0a390e7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Assets/JCSUnity/Scripts/Util/JCS_Vector.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,13 +320,13 @@ public static Vector3 GetFinalLocalEulerAngles(Transform trans, ref Vector3 inEu
320320
/// <summary>
321321
/// Make the vector to a ground vector.
322322
/// </summary>
323-
public static Vector3 GroundVector(Vector3 vec)
323+
public static Vector3 GroundVector(Vector3 vec, float y = 0.0f)
324324
{
325-
return new Vector3(vec.x, 0.0f, vec.z);
325+
return new Vector3(vec.x, y, vec.z);
326326
}
327-
public static Vector2 GroundVector(Vector2 vec)
327+
public static Vector2 GroundVector(Vector2 vec, float y = 0.0f)
328328
{
329-
return new Vector3(vec.x, 0.0f);
329+
return new Vector3(vec.x, y);
330330
}
331331

332332
/// <summary>

0 commit comments

Comments
 (0)