解决切换视角地图高度变化的问题
This commit is contained in:
parent
541aefe4dd
commit
4064d4294a
@ -189,6 +189,8 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
mapRouteRankingList = shaowList.data.list;
|
mapRouteRankingList = shaowList.data.list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Vector3 mapPos = Vector3.zero;
|
||||||
//加载人物和地图以及UI界面
|
//加载人物和地图以及UI界面
|
||||||
private void InitGameObject()
|
private void InitGameObject()
|
||||||
{
|
{
|
||||||
@ -197,6 +199,7 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
UIObject.SetActive(true);
|
UIObject.SetActive(true);
|
||||||
miniMap.SetActive(true);
|
miniMap.SetActive(true);
|
||||||
map.OnTileFinished += Map_OnTileFinished;
|
map.OnTileFinished += Map_OnTileFinished;
|
||||||
|
mapPos = map.transform.position;
|
||||||
}
|
}
|
||||||
|
|
||||||
//private void Map_OnTileFinished(Mapbox.Unity.MeshGeneration.Data.UnityTile obj)
|
//private void Map_OnTileFinished(Mapbox.Unity.MeshGeneration.Data.UnityTile obj)
|
||||||
@ -359,6 +362,7 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
map.Terrain.SetElevationType(ElevationLayerType.TerrainWithElevation);
|
map.Terrain.SetElevationType(ElevationLayerType.TerrainWithElevation);
|
||||||
map.ImageLayer.SetLayerSource(ImagerySourceType.Custom);
|
map.ImageLayer.SetLayerSource(ImagerySourceType.Custom);
|
||||||
map.SetCenterLatitudeLongitude(playerController.Currentlatlong);
|
map.SetCenterLatitudeLongitude(playerController.Currentlatlong);
|
||||||
|
map.transform.position = mapPos;
|
||||||
//map3d.gameObject.SetActive(true);
|
//map3d.gameObject.SetActive(true);
|
||||||
//map.gameObject.SetActive(false);
|
//map.gameObject.SetActive(false);
|
||||||
//人物属性变更
|
//人物属性变更
|
||||||
@ -378,6 +382,7 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
map.Terrain.ExaggerationFactor = 0f;
|
map.Terrain.ExaggerationFactor = 0f;
|
||||||
map.Terrain.SetElevationType(ElevationLayerType.FlatTerrain);
|
map.Terrain.SetElevationType(ElevationLayerType.FlatTerrain);
|
||||||
map.SetCenterLatitudeLongitude(playerController.Currentlatlong);
|
map.SetCenterLatitudeLongitude(playerController.Currentlatlong);
|
||||||
|
map.transform.position = Vector3.zero;
|
||||||
//map.gameObject.SetActive(true);
|
//map.gameObject.SetActive(true);
|
||||||
//map3d.gameObject.SetActive(false);
|
//map3d.gameObject.SetActive(false);
|
||||||
//人物属性变更
|
//人物属性变更
|
||||||
@ -401,6 +406,7 @@ public class CyclingController : DeviceServiceMonoBase
|
|||||||
player.transform.localScale = new Vector3(3f, 3f, 3f);
|
player.transform.localScale = new Vector3(3f, 3f, 3f);
|
||||||
var locations = playerController.Currentlatlong == null ? playerController.Currentlatlong : new Vector2d(mapData.List[0].Point[0], mapData.List[0].Point[1]);
|
var locations = playerController.Currentlatlong == null ? playerController.Currentlatlong : new Vector2d(mapData.List[0].Point[0], mapData.List[0].Point[1]);
|
||||||
player.transform.position = map.GeoToWorldPosition(locations);
|
player.transform.position = map.GeoToWorldPosition(locations);
|
||||||
|
mapPos = map.transform.position;
|
||||||
if (recorderData != null)
|
if (recorderData != null)
|
||||||
{
|
{
|
||||||
var lastLatLon = Along(recorderData.EndDistance);
|
var lastLatLon = Along(recorderData.EndDistance);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user