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