//更新路径信息 public void UpdateMapPath() { SceneMapInfo sceneMapInfo = GetSceneMapInfo(); if (sceneMapInfo != null) { AStarMapPath mapPath = new AStarMapPath(sceneMapInfo.grids); SetTmp("mapPath", mapPath); } }
//获得基准坐标 public Vector2Int GetOffsetPos() { SceneMapInfo sceneMapInfo = GetSceneMapInfo(); if (sceneMapInfo != null) { return(sceneMapInfo.offsetPos); } return(Vector2Int.zero); }
public SceneMapInfo GetSceneMapInfo() { SceneMapInfo sceneMapInfo = null; if (Get <bool>("is_dynamic_map")) { string src = Get <string>("src", ""); if (src.Length > 0) { var cfgSceneData = CfgScene.Instance.get_by_id(src); sceneMapInfo = cfgSceneData.GetSceneMapInfo(); } } else { sceneMapInfo = Get <SceneMapInfo>("sceneMapInfo"); } return(sceneMapInfo); }
// 自身投影数据 project_grids[x][y] public int[][] GetProjectGrids() { SceneMapInfo sceneMapInfo = GetSceneMapInfo(); return(sceneMapInfo?.projectGrids); }
//自身障碍数据 grids[x][y] public int[][] GetGrids() { SceneMapInfo sceneMapInfo = GetSceneMapInfo(); return(sceneMapInfo?.grids); }