From 46e28cbf9c02b87b8c8f2caa8f5211a1eb4ca669 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Tue, 31 Dec 2024 17:27:27 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Actions/MoveAction.cs | 8 +++++++- Assets/Scripts/UI/UIPointQuestion.cs | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Actions/MoveAction.cs b/Assets/Scripts/Actions/MoveAction.cs index 8226976c..5543055c 100644 --- a/Assets/Scripts/Actions/MoveAction.cs +++ b/Assets/Scripts/Actions/MoveAction.cs @@ -19,7 +19,7 @@ public class MoveAction : IAction Vector3 pos; float time; string path; - public static MoveAction Allocate(string path , Vector3 pos, float time, System.Action onDelayFinish = null) + public static MoveAction Allocate(string path, Vector3 pos, float time, System.Action onDelayFinish = null) { var retNode = mPool.Allocate(); retNode.ActionID = ActionKit.ID_GENERATOR++; @@ -53,6 +53,12 @@ public class MoveAction : IAction public void OnStart() { GameObject obj = Utility.FindObj(path); + if (obj == null) + { + Debug.LogError($"ûҵ·{path}"); + return; + } + obj.transform.DOMove(pos, time).onComplete = () => this.Finish(); ; } diff --git a/Assets/Scripts/UI/UIPointQuestion.cs b/Assets/Scripts/UI/UIPointQuestion.cs index f9cb7d81..cb8ba3e3 100644 --- a/Assets/Scripts/UI/UIPointQuestion.cs +++ b/Assets/Scripts/UI/UIPointQuestion.cs @@ -41,6 +41,10 @@ namespace QFramework.Example point.name = (i + 1).ToString(); pointMap.Add(obj, point); } + else + { + Debug.LogError($"ûҵ·{path}"); + } } } From bc24fdb3d8be31ee5b3d27aa7d5e449a5aaa4cc0 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Tue, 31 Dec 2024 17:40:54 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=80=8D=E9=80=9F?= =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/TimeScaleController.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Assets/Scripts/TimeScaleController.cs b/Assets/Scripts/TimeScaleController.cs index 95a26458..d2afdbe3 100644 --- a/Assets/Scripts/TimeScaleController.cs +++ b/Assets/Scripts/TimeScaleController.cs @@ -9,7 +9,6 @@ public class TimeScaleController : MonoBehaviour public float animSpeed = 1.0f; -#if UNITY_EDITOR private void Update() { Time.timeScale = animSpeed; @@ -30,5 +29,5 @@ public class TimeScaleController : MonoBehaviour animSpeed = 0; } } -#endif + } From ce4418010a51d52d9c331b1791e3075a79f1378c Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Thu, 2 Jan 2025 09:49:19 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=89=A9=E5=B1=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/TimeScaleController.cs | 21 +++++++++++++++++-- .../Plugins/WebGLDownloadFile.jslib | 14 ++++++++++++- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/TimeScaleController.cs b/Assets/Scripts/TimeScaleController.cs index d2afdbe3..8699dd02 100644 --- a/Assets/Scripts/TimeScaleController.cs +++ b/Assets/Scripts/TimeScaleController.cs @@ -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 } } diff --git a/Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib b/Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib index 925f54ef..dcdfd155 100644 --- a/Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib +++ b/Assets/WebGLDownLoadWord/Plugins/WebGLDownloadFile.jslib @@ -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 { + } + } }); From 8e86da4115d86224308ed620b3aacc44804c9cb8 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Thu, 2 Jan 2025 09:49:57 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E5=9C=BA=E6=99=AF=E6=8C=82=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E9=94=AE=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scenes/Main.unity | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index f69b36e7..98f9628d 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -139,6 +139,7 @@ GameObject: - component: {fileID: 547432238} - component: {fileID: 547432237} - component: {fileID: 547432236} + - component: {fileID: 547432244} m_Layer: 0 m_Name: FlyCamera m_TagString: MainCamera @@ -340,6 +341,19 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 19.976, y: 11.67, z: 0} +--- !u!114 &547432244 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 547432235} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b2c08eae7cce6c9479adebcaad5706c3, type: 3} + m_Name: + m_EditorClassIdentifier: + animSpeed: 1 --- !u!1 &1089184132 GameObject: m_ObjectHideFlags: 0 From c40affec6c11c66e38406318da974b7a23c53bec Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Thu, 2 Jan 2025 10:19:41 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=84=9A=E6=9C=ACbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Actions/AnimationAction.cs | 1 + Assets/Scripts/TimeScaleController.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Actions/AnimationAction.cs b/Assets/Scripts/Actions/AnimationAction.cs index 5a9691af..103cffbd 100644 --- a/Assets/Scripts/Actions/AnimationAction.cs +++ b/Assets/Scripts/Actions/AnimationAction.cs @@ -54,6 +54,7 @@ namespace QFramework { int curFrame = 0; int.TryParse(frame, out curFrame); + anim.clip = anim[animName].clip; anim[animName].time = curFrame / anim.clip.frameRate; anim[animName].speed = 0; anim.Play(animName); diff --git a/Assets/Scripts/TimeScaleController.cs b/Assets/Scripts/TimeScaleController.cs index 8699dd02..7154704b 100644 --- a/Assets/Scripts/TimeScaleController.cs +++ b/Assets/Scripts/TimeScaleController.cs @@ -34,7 +34,7 @@ public class TimeScaleController : MonoBehaviour #if UNITY_WEBGL if (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightControl)) { - if (Input.GetKeyDown(KeyCode.W)) + if (Input.GetKeyDown(KeyCode.A)) { Debug.Log("Ctrl + W £"); string str = string.Empty; From 837a2bcdbf7e1766f8abeda39514a87ec8f62fd3 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Thu, 2 Jan 2025 10:24:01 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/TimeScaleController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/TimeScaleController.cs b/Assets/Scripts/TimeScaleController.cs index 7154704b..5e8be5ce 100644 --- a/Assets/Scripts/TimeScaleController.cs +++ b/Assets/Scripts/TimeScaleController.cs @@ -34,9 +34,9 @@ public class TimeScaleController : MonoBehaviour #if UNITY_WEBGL if (Input.GetKey(KeyCode.LeftAlt) || Input.GetKey(KeyCode.RightControl)) { - if (Input.GetKeyDown(KeyCode.A)) + if (Input.GetKeyDown(KeyCode.Q)) { - Debug.Log("Ctrl + W £"); + Debug.Log("Ctrl + Q £"); string str = string.Empty; str = $"Posision:{gameObject.transform.position}\nRotate:{gameObject.transform.eulerAngles}";