Skip to content

Commit c8c0d60

Browse files
committed
feat(Util): Make groud vector accept transform
1 parent 28c2732 commit c8c0d60

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Assets/JCSUnity/Scripts/Util/JCS_Vector.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,18 @@ public static Vector3 GetFinalLocalEulerAngles(Transform trans, ref Vector3 inEu
326326
/// <summary>
327327
/// Make the vector to a ground vector.
328328
/// </summary>
329+
public static Vector3 GroundVector(Vector3 vec, Vector3 ground)
330+
{
331+
return GroundVector(vec, ground.y);
332+
}
329333
public static Vector3 GroundVector(Vector3 vec, float y = 0.0f)
330334
{
331335
return new Vector3(vec.x, y, vec.z);
332336
}
337+
public static Vector2 GroundVector(Vector2 vec, Vector3 ground)
338+
{
339+
return GroundVector(vec, ground.y);
340+
}
333341
public static Vector2 GroundVector(Vector2 vec, float y = 0.0f)
334342
{
335343
return new Vector3(vec.x, y);

0 commit comments

Comments
 (0)