调整大地图样式和地球样式
This commit is contained in:
1 parent
392eca5dc2
commit
071a0e1170
6 files changed
+726
-395
No files matched your search
@@ -70,15 +70,17 @@ public class BigMapController : PFUIPanel
|
||||
IEnumerator Main()
|
||||
{
|
||||
mapManager = this.transform.Find("Map").GetComponent<AbstractMap>();
|
||||
mapManager.MaxZoom = 4;
|
||||
//mapManager.MaxZoom = 4;
|
||||
mapManager.OnInitialized += MapManager_OnInitialized;
|
||||
mapManager.OnUpdated += MapManager_OnUpdated;
|
||||
|
||||
//// mapManager.OnTileFinished += MapManager_OnTileFinished;
|
||||
mapManager.SetZoom(5.8f);
|
||||
//mapManager.SetZoom(5.8f);
|
||||
|
||||
//mapManager.SetCenterLatitudeLongitude(new Mapbox.Utils.Vector2d(32.051203, 118.771572));
|
||||
|
||||
this.transform.Find("Map").GetComponent<QuadTreeCameraMovement>()._referenceCamera = Camera.main;
|
||||
|
||||
|
||||
canvas = this.transform.Find("Canvas").gameObject;
|
||||
canvas.GetComponent<Canvas>().worldCamera = Camera.main;
|
||||
@@ -167,14 +169,17 @@ public class BigMapController : PFUIPanel
|
||||
//Debug.Log(infoStr);
|
||||
var info = Newtonsoft.Json.Linq.JObject.Parse(infoStr);
|
||||
|
||||
var center = (info["features"] as JArray).First()["center"];
|
||||
mapManager.UpdateMap(new Vector2d(Convert.ToDouble(center[1]), Convert.ToDouble(center[0])));
|
||||
|
||||
var features = (info["features"] as JArray);
|
||||
if (features.Count > 0) {
|
||||
var center = features.First()["center"];
|
||||
mapManager.UpdateMap(new Vector2d(Convert.ToDouble(center[1]), Convert.ToDouble(center[0])));
|
||||
}
|
||||
UIManager.HideLoadingDialogBox();
|
||||
}
|
||||
|
||||
private void MapManager_OnInitialized()
|
||||
{
|
||||
mapManager.UpdateMap(5.8f);
|
||||
Load();
|
||||
}
|
||||
private void MapManager_OnUpdated()
|
||||
|
||||
@@ -7,6 +7,7 @@ using UnityEngine.UI;
|
||||
using Assets.Scripts.Apis;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Assets.Scripts;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class EarthController : PFUIPanel
|
||||
{
|
||||
@@ -61,7 +62,17 @@ public class EarthController : PFUIPanel
|
||||
panel = rootPanel.Find("Panel").gameObject;
|
||||
SetRounded(panel.transform, 60);
|
||||
panel.gameObject.SetActive(false);
|
||||
|
||||
|
||||
|
||||
var goList = rootPanel.transform.Find("SwitchMode");
|
||||
SetRounded(goList, 64);
|
||||
UIManager.AddEvent(goList.Find("GoList").gameObject, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
//UIManager.PopStack();
|
||||
UIManager.ShowMapListPanel();
|
||||
//this.gameObject.SetActive(false);
|
||||
//DestroyImmediate(this.gameObject);
|
||||
});
|
||||
|
||||
maskImage = rootPanel.Find("MaskImage").GetComponent<RawImage>();
|
||||
|
||||
@@ -85,7 +96,7 @@ public class EarthController : PFUIPanel
|
||||
Camera.main.transform.rotation = Quaternion.Euler(0, 0, 0);
|
||||
|
||||
|
||||
map.SetZoomLevel(1.43f);
|
||||
map.SetZoomLevel(2.6f);
|
||||
//var zoom = map.GetZoomLevel();
|
||||
//Debug.Log(zoom);
|
||||
map.OnZoomStart += Map_OnZoomStart;
|
||||
@@ -139,8 +150,12 @@ public class EarthController : PFUIPanel
|
||||
var latLon = province.latlonCenter;
|
||||
EnterBigMap(latLon);
|
||||
};
|
||||
}
|
||||
|
||||
skybox = Camera.main.GetComponent<Skybox>();
|
||||
Debug.Log(skybox != null);
|
||||
}
|
||||
private float rot = 0;
|
||||
Skybox skybox;
|
||||
/// <summary>
|
||||
/// 显示概要信息
|
||||
/// </summary>
|
||||
@@ -246,6 +261,10 @@ public class EarthController : PFUIPanel
|
||||
}
|
||||
}
|
||||
//Debug.Log(showSummary + "," + time);
|
||||
|
||||
//rot += 0.1f * Time.deltaTime;
|
||||
//rot %= 360;
|
||||
//skybox.material.SetFloat("_Rotation", rot);
|
||||
}
|
||||
|
||||
public void Show(double lat, double lon)
|
||||
|
||||
Reference in new issue
Block a user