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}"); + } } }