From e7b3aa77dff3d9f176cd5458b1f395157957e8f5 Mon Sep 17 00:00:00 2001 From: MrGadget <9826063+MrGadget1024@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:43:44 -0400 Subject: [PATCH] fix(Extentions): GetLocalPositionAndRotation and SetLocalPositionAndRotation --- Assets/Mirror/Core/Tools/Extensions.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Assets/Mirror/Core/Tools/Extensions.cs b/Assets/Mirror/Core/Tools/Extensions.cs index 839481e2b..e9399b3a5 100644 --- a/Assets/Mirror/Core/Tools/Extensions.cs +++ b/Assets/Mirror/Core/Tools/Extensions.cs @@ -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.