From 4e33c3b66fb202650443867f65d0a68f8f96cfcb Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Fri, 3 Jan 2025 17:37:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/TimeScaleController.cs | 34 ++++++++++++++++++++------- ProjectSettings/ProjectSettings.asset | 2 +- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/Assets/Scripts/TimeScaleController.cs b/Assets/Scripts/TimeScaleController.cs index fb3cfb1e..346d9436 100644 --- a/Assets/Scripts/TimeScaleController.cs +++ b/Assets/Scripts/TimeScaleController.cs @@ -37,20 +37,38 @@ public class TimeScaleController : MonoBehaviour { animSpeed = 0; } -#if UNITY_WEBGL if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) { if (Input.GetKeyDown(KeyCode.Q)) { - Debug.Log("Ctrl + Q £"); string str = string.Empty; - str = $"Posision:{gameObject.transform.position}\nRotate:{gameObject.transform.eulerAngles}"; - + str = $"{gameObject.transform.position}|{gameObject.transform.eulerAngles}"; +#if UNITY_WEBGL + Debug.Log("Ctrl + Q £"); CopyToClipboard(str); - - } - } +#elif UNITY_STANDALONE_WIN && !UNITY_EDITOR + // ʾ + // ݵ + GUIUtility.systemCopyBuffer = str; #endif - } + } +#if UNITY_STANDALONE_WIN &&!UNITY_EDITOR + if (Input.GetKeyDown(KeyCode.E)) + { + string tmp = GUIUtility.systemCopyBuffer; + Debug.LogError("ǰ壺" + tmp); + tmp = tmp.Replace("(", ""); + Debug.LogError(tmp); + tmp = tmp.Replace(")", ""); + Debug.LogError(tmp); + var datas = tmp.Split('|'); + Debug.LogError(datas[0]); + Debug.LogError(datas[1]); + gameObject.transform.position = Utility.GetVector3FromStrArray(datas[0]); + gameObject.transform.eulerAngles = Utility.GetVector3FromStrArray(datas[1]); + } +#endif + } + } } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 602b97e7..130e523f 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -845,7 +845,7 @@ PlayerSettings: PS5: DOTWEEN QNX: DOTWEEN Stadia: DOTWEEN - Standalone: DOTWEEN;VR + Standalone: DOTWEEN VisionOS: DOTWEEN WebGL: DOTWEEN Windows Store Apps: DOTWEEN