新增工具扩展
This commit is contained in:
parent
bc24fdb3d8
commit
ce4418010a
@ -1,13 +1,16 @@
|
||||
using QFramework;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class TimeScaleController : MonoBehaviour
|
||||
{
|
||||
|
||||
[Range(0, 10)]
|
||||
public float animSpeed = 1.0f;
|
||||
|
||||
#if UNITY_WEBGL
|
||||
[System.Runtime.InteropServices.DllImport("__Internal")]
|
||||
private static extern void CopyToClipboard(string text);
|
||||
#endif
|
||||
|
||||
private void Update()
|
||||
{
|
||||
@ -28,6 +31,20 @@ public class TimeScaleController : MonoBehaviour
|
||||
{
|
||||
animSpeed = 0;
|
||||
}
|
||||
#if UNITY_WEBGL
|
||||
if (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightControl))
|
||||
{
|
||||
if (Input.GetKeyDown(KeyCode.W))
|
||||
{
|
||||
Debug.Log("Ctrl + W ±»°´Ï£¡");
|
||||
string str = string.Empty;
|
||||
str = $"Posision:{gameObject.transform.position}\nRotate:{gameObject.transform.eulerAngles}";
|
||||
|
||||
CopyToClipboard(str);
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -11,5 +11,17 @@ mergeInto(LibraryManager.library, {
|
||||
|
||||
HtmlDownloadWord(bytes,reportdata);
|
||||
|
||||
}
|
||||
},
|
||||
CopyToClipboard: function(text) {
|
||||
|
||||
var str = Pointer_stringify(text);
|
||||
|
||||
|
||||
if (navigator.clipboard) {
|
||||
navigator.clipboard.writeText(str).then(function() {
|
||||
}).catch(function(error) {
|
||||
});
|
||||
} else {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user