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] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF=E6=8F=90?= =?UTF-8?q?=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}"); + } } }