This commit is contained in:
huyulong 2024-12-16 15:02:02 +08:00
commit 58fa69a3b9
2 changed files with 19 additions and 2 deletions

View File

@ -22,14 +22,29 @@ public class TaskPanel : Base
public float hidePositionX = 125f;
public float showPositionX = -198f;
public List<int> taskIDs = new List<int>();
private List<TaskItem> taskItems = new List<TaskItem>(); // 当前显示的任务列表
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()
{

View File

@ -86,7 +86,7 @@ public class RecuseNpc : MonoBehaviour
//添加npc的目的地到list中
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;