Example #1
0
        //更新路径信息
        public void UpdateMapPath()
        {
            SceneMapInfo sceneMapInfo = GetSceneMapInfo();

            if (sceneMapInfo != null)
            {
                AStarMapPath mapPath = new AStarMapPath(sceneMapInfo.grids);
                SetTmp("mapPath", mapPath);
            }
        }
Example #2
0
        //获得基准坐标
        public Vector2Int GetOffsetPos()
        {
            SceneMapInfo sceneMapInfo = GetSceneMapInfo();

            if (sceneMapInfo != null)
            {
                return(sceneMapInfo.offsetPos);
            }
            return(Vector2Int.zero);
        }
Example #3
0
        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);
        }
Example #4
0
        // 自身投影数据 project_grids[x][y]
        public int[][] GetProjectGrids()
        {
            SceneMapInfo sceneMapInfo = GetSceneMapInfo();

            return(sceneMapInfo?.projectGrids);
        }
Example #5
0
        //自身障碍数据 grids[x][y]
        public int[][] GetGrids()
        {
            SceneMapInfo sceneMapInfo = GetSceneMapInfo();

            return(sceneMapInfo?.grids);
        }