2025-01-02 09:49:19 +08:00
|
|
|
|
using QFramework;
|
2024-12-27 17:25:30 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
public class TimeScaleController : MonoBehaviour
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
[Range(0, 10)]
|
|
|
|
|
|
public float animSpeed = 1.0f;
|
2025-01-02 09:49:19 +08:00
|
|
|
|
#if UNITY_WEBGL
|
|
|
|
|
|
[System.Runtime.InteropServices.DllImport("__Internal")]
|
|
|
|
|
|
private static extern void CopyToClipboard(string text);
|
|
|
|
|
|
#endif
|
2024-12-27 17:25:30 +08:00
|
|
|
|
|
2025-01-03 17:00:55 +08:00
|
|
|
|
private void Awake()
|
|
|
|
|
|
{
|
|
|
|
|
|
#if VR
|
|
|
|
|
|
gameObject.SetActive(false);
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
2024-12-27 17:25:30 +08:00
|
|
|
|
private void Update()
|
|
|
|
|
|
{
|
|
|
|
|
|
Time.timeScale = animSpeed;
|
2024-12-30 11:42:27 +08:00
|
|
|
|
if (Input.GetKeyUp(KeyCode.F8))
|
|
|
|
|
|
{
|
|
|
|
|
|
animSpeed++;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Input.GetKeyUp(KeyCode.F7))
|
|
|
|
|
|
{
|
|
|
|
|
|
animSpeed--;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Input.GetKeyUp(KeyCode.F12))
|
|
|
|
|
|
{
|
|
|
|
|
|
animSpeed = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (Input.GetKeyUp(KeyCode.F11))
|
|
|
|
|
|
{
|
|
|
|
|
|
animSpeed = 0;
|
|
|
|
|
|
}
|
2025-01-02 10:24:55 +08:00
|
|
|
|
if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))
|
2025-01-02 09:49:19 +08:00
|
|
|
|
{
|
2025-02-28 17:30:07 +08:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.C))
|
2025-01-02 09:49:19 +08:00
|
|
|
|
{
|
|
|
|
|
|
string str = string.Empty;
|
2025-01-03 17:37:06 +08:00
|
|
|
|
str = $"{gameObject.transform.position}|{gameObject.transform.eulerAngles}";
|
|
|
|
|
|
#if UNITY_WEBGL
|
2025-02-28 17:30:07 +08:00
|
|
|
|
Debug.Log("Ctrl + Q <20><><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>"+str);
|
2025-01-02 09:49:19 +08:00
|
|
|
|
CopyToClipboard(str);
|
2025-01-03 17:37:06 +08:00
|
|
|
|
#elif UNITY_STANDALONE_WIN && !UNITY_EDITOR
|
|
|
|
|
|
// ʾ<><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD><DDB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
GUIUtility.systemCopyBuffer = str;
|
|
|
|
|
|
#endif
|
|
|
|
|
|
}
|
|
|
|
|
|
#if UNITY_STANDALONE_WIN &&!UNITY_EDITOR
|
2025-02-28 17:30:07 +08:00
|
|
|
|
if (Input.GetKeyDown(KeyCode.V))
|
2025-01-03 17:37:06 +08:00
|
|
|
|
{
|
|
|
|
|
|
string tmp = GUIUtility.systemCopyBuffer;
|
2025-02-28 17:30:07 +08:00
|
|
|
|
Debug.Log("<22><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>壺" + tmp);
|
2025-01-03 17:37:06 +08:00
|
|
|
|
tmp = tmp.Replace("(", "");
|
|
|
|
|
|
tmp = tmp.Replace(")", "");
|
|
|
|
|
|
var datas = tmp.Split('|');
|
2025-01-02 09:49:19 +08:00
|
|
|
|
|
2025-01-03 17:37:06 +08:00
|
|
|
|
gameObject.transform.position = Utility.GetVector3FromStrArray(datas[0]);
|
|
|
|
|
|
gameObject.transform.eulerAngles = Utility.GetVector3FromStrArray(datas[1]);
|
2025-01-02 09:49:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
#endif
|
2025-01-03 17:37:06 +08:00
|
|
|
|
}
|
2024-12-27 17:25:30 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|