diff --git a/xiaofang/Assets/Res/HYLUI/TaskPanel.cs b/xiaofang/Assets/Res/HYLUI/TaskPanel.cs index 785f185e..6da73538 100644 --- a/xiaofang/Assets/Res/HYLUI/TaskPanel.cs +++ b/xiaofang/Assets/Res/HYLUI/TaskPanel.cs @@ -22,14 +22,29 @@ public class TaskPanel : Base public float hidePositionX = 125f; public float showPositionX = -198f; + public List taskIDs = new List(); + private List taskItems = new List(); // 当前显示的任务列表 void Start() { instance = this; hideBtn.onClick.AddListener(OnClickHideButton); + InitList(); + //InitTask(taskIDs); } + public void InitList() + { + foreach (Task_ task in JSONReader.TaskDictionary.Values) + { + if (int.TryParse(task.ID, out int taskId)) + { + // 转换成功,添加到 taskIDs 列表 + taskIDs.Add(taskId); + } + } + } // 将任务栏收起或显示 public void OnClickHideButton() { diff --git a/xiaofang/Assets/Script/npc/RecuseNpc.cs b/xiaofang/Assets/Script/npc/RecuseNpc.cs index c12ad6aa..1b102ce7 100644 --- a/xiaofang/Assets/Script/npc/RecuseNpc.cs +++ b/xiaofang/Assets/Script/npc/RecuseNpc.cs @@ -86,7 +86,7 @@ public class RecuseNpc : MonoBehaviour //娣诲姞npc鐨勭洰鐨勫湴鍒發ist涓 public void SetNpcDes(Vector3 tar) { - Debug.Log(tar); + Debug.Log(tar+"鐩爣璺緞鐐"); target.position = tar; Debug.Log(target); @@ -100,7 +100,9 @@ public class RecuseNpc : MonoBehaviour tar = hit.position; // 灏嗙洰鏍囩偣璋冩暣鍒版渶杩戠殑瀵艰埅缃戞牸浣嶇疆 } Debug.Log("杩涘叆濂旇窇++++++="); + //targetPoints.Clear(); targetPoints.Add(tar); + } @@ -126,7 +128,7 @@ public class RecuseNpc : MonoBehaviour if (targetPoints.Count > 0 && currentTarget != null) { - currentTarget = targetPoints[0]; + currentTarget = targetPoints[targetPoints.Count-1]; nstate = Npcstate.run; movebool = true;