Skip to content

Commit

Permalink
fix(Extentions): GetLocalPositionAndRotation and SetLocalPositionAndR…
Browse files Browse the repository at this point in the history
…otation
  • Loading branch information
MrGadget1024 committed Oct 29, 2024
1 parent f615248 commit e7b3aa7
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Assets/Mirror/Core/Tools/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ public static void SetPositionAndRotation(this Transform transform, Vector3 posi
transform.position = position;
transform.rotation = rotation;
}

public static void GetLocalPositionAndRotation(this Transform transform, out Vector3 position, out Quaternion rotation)
{
position = transform.localPosition;
rotation = transform.localRotation;
}

public static void SetLocalPositionAndRotation(this Transform transform, Vector3 position, Quaternion rotation)
{
transform.localPosition = position;
transform.localRotation = rotation;
}
#endif

// IPEndPoint address only to pretty string.
Expand Down

0 comments on commit e7b3aa7

Please sign in to comment.