Merge branch 'main' of http://shu.sheziwanglo.cn:3000/wulongxiao/_xiaofang
This commit is contained in:
commit
58fa69a3b9
@ -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()
|
||||
{
|
||||
|
@ -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,8 +100,10 @@ public class RecuseNpc : MonoBehaviour
|
||||
tar = hit.position; // 将目标点调整到最近的导航网格位置
|
||||
}
|
||||
Debug.Log("进入奔跑++++++=");
|
||||
//targetPoints.Clear();
|
||||
targetPoints.Add(tar);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user