|
@@ -435,89 +435,7 @@ public class GCJKLayer : YZTRootLayer
|
|
weiYiToggle.onValueChanged.AddListener(SetWeiYiIconActive);
|
|
weiYiToggle.onValueChanged.AddListener(SetWeiYiIconActive);
|
|
|
|
|
|
|
|
|
|
- globalWeatherBtn.onClick.AddListener(async() => {
|
|
|
|
-
|
|
|
|
- if(GlobalData.qXZDatas.Count < 1 || GlobalData.sWZDatas.Count < 1)
|
|
|
|
- await HttpHelper._Instance.InitGCJKData();
|
|
|
|
-
|
|
|
|
- GameObject shaPan = GameObject.FindGameObjectWithTag("ShaPan");
|
|
|
|
- CameraManager.SwitchCamera(1);
|
|
|
|
- if (dropUnits.Count <= 0)
|
|
|
|
- {
|
|
|
|
- CameraManager.SwitchCamera(1);
|
|
|
|
- viewMode = ViewMode.miniMap;
|
|
|
|
- dropUnits = new List<DropUnit>();
|
|
|
|
- weatherUnits = new List<WeatherUnit>();
|
|
|
|
- for (int i = 0; i < GlobalData.qXZDatas.Count; i++)
|
|
|
|
- {
|
|
|
|
- GameObject gameObject = Instantiate(dropUnitPrefab);
|
|
|
|
- DropUnit dropUnit = gameObject.GetComponent<DropUnit>();
|
|
|
|
- dropUnit.transform.SetParent(miniMapQXContent.transform);
|
|
|
|
- dropUnit.Init(GlobalData.qXZDatas[i].LGTD, GlobalData.qXZDatas[i].LTTD, GlobalData.qXZDatas[i].STNM, GlobalData.qXZDatas[i].dropSum6.ToString());
|
|
|
|
- dropUnits.Add(dropUnit);
|
|
|
|
-
|
|
|
|
- dropUnit.bingObj = Instantiate(runtimePointObj).gameObject;
|
|
|
|
- dropUnit.bingObj.transform.SetParent(shaPan.transform.GetChild(7));
|
|
|
|
- dropUnit.bingObj.transform.localEulerAngles = Vector3.zero;
|
|
|
|
- dropUnit.bingObj.transform.localScale = Vector3.one;
|
|
|
|
- dropUnit.bingObj.transform.localPosition = CoordinateConverter.GeoToUGUISmall(GlobalData.qXZDatas[i].LGTD, GlobalData.qXZDatas[i].LTTD);
|
|
|
|
- dropUnit.bingObj.name = GlobalData.qXZDatas[i].STNM;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- for (int i = 0; i < GlobalData.sWZDatas.Count; i++)
|
|
|
|
- {
|
|
|
|
- GameObject gameObject = Instantiate(dropUnitPrefab);
|
|
|
|
- DropUnit dropUnit = gameObject.GetComponent<DropUnit>();
|
|
|
|
- dropUnit.transform.SetParent(miniMapSWContent.transform);
|
|
|
|
- dropUnit.Init(GlobalData.sWZDatas[i].LGTD, GlobalData.sWZDatas[i].LTTD, GlobalData.sWZDatas[i].STNM, GlobalData.sWZDatas[i].dropSum6.ToString());
|
|
|
|
- dropUnits.Add(dropUnit);
|
|
|
|
-
|
|
|
|
- dropUnit.bingObj = Instantiate(runtimePointObj).gameObject;
|
|
|
|
- dropUnit.bingObj.transform.SetParent(shaPan.transform.GetChild(8));
|
|
|
|
- dropUnit.bingObj.transform.localEulerAngles = Vector3.zero;
|
|
|
|
- dropUnit.bingObj.transform.localScale = Vector3.one;
|
|
|
|
- dropUnit.bingObj.transform.localPosition = CoordinateConverter.GeoToUGUISmall(GlobalData.sWZDatas[i].LGTD, GlobalData.sWZDatas[i].LTTD);
|
|
|
|
- dropUnit.bingObj.name = GlobalData.sWZDatas[i].STNM;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- for (int i = 0; i < GlobalData.qXZDatas.Count; i++)
|
|
|
|
- {
|
|
|
|
- dropUnits[i].Init(GlobalData.qXZDatas[i].LGTD, GlobalData.qXZDatas[i].LTTD, GlobalData.qXZDatas[i].STNM, GlobalData.qXZDatas[i].dropSum6.ToString());
|
|
|
|
- }
|
|
|
|
- for (int i = 0; i < GlobalData.sWZDatas.Count; i++)
|
|
|
|
- {
|
|
|
|
- dropUnits[i].Init(GlobalData.sWZDatas[i].LGTD, GlobalData.sWZDatas[i].LTTD, GlobalData.sWZDatas[i].STNM, GlobalData.sWZDatas[i].dropSum6.ToString());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- if (weatherUnits.Count <= 0)
|
|
|
|
- {
|
|
|
|
- for (int i = 0; i < GlobalData.sWZDatas.Count; i++)
|
|
|
|
- {
|
|
|
|
- GameObject gameObject = Instantiate(weatherUnitPrefab);
|
|
|
|
- WeatherUnit weatherUnit = gameObject.GetComponent<WeatherUnit>();
|
|
|
|
- weatherUnit.transform.SetParent(miniMapSWContent.transform);
|
|
|
|
- weatherUnit.Init(GlobalData.sWZDatas[i].LGTD, GlobalData.sWZDatas[i].LTTD, GlobalData.sWZDatas[i].STNM, GlobalData.sWZDatas[i].wth);
|
|
|
|
- weatherUnits.Add(weatherUnit);
|
|
|
|
-
|
|
|
|
- weatherUnit.bingObj = Instantiate(runtimePointObj).gameObject;
|
|
|
|
- weatherUnit.bingObj.transform.SetParent(shaPan.transform.GetChild(8));
|
|
|
|
- weatherUnit.bingObj.transform.localEulerAngles = Vector3.zero;
|
|
|
|
- weatherUnit.bingObj.transform.localScale = Vector3.one;
|
|
|
|
- weatherUnit.bingObj.transform.localPosition = CoordinateConverter.GeoToUGUISmall(GlobalData.sWZDatas[i].LGTD, GlobalData.sWZDatas[i].LTTD);
|
|
|
|
- weatherUnit.bingObj.name = GlobalData.sWZDatas[i].STNM;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- for (int i = 0; i < GlobalData.sWZDatas.Count; i++)
|
|
|
|
- {
|
|
|
|
- weatherUnits[i].Init(GlobalData.sWZDatas[i].LGTD, GlobalData.sWZDatas[i].LTTD, GlobalData.sWZDatas[i].STNM, GlobalData.sWZDatas[i].wth);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- miniMap.gameObject.SetActive(true);
|
|
|
|
- main.gameObject.SetActive(false);
|
|
|
|
- });
|
|
|
|
|
|
+ globalWeatherBtn.onClick.AddListener(OnGlobalWeatherClick);
|
|
|
|
|
|
exitGlobalWeatherBtn.onClick.AddListener(() =>
|
|
exitGlobalWeatherBtn.onClick.AddListener(() =>
|
|
{
|
|
{
|
|
@@ -563,6 +481,93 @@ public class GCJKLayer : YZTRootLayer
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public async void OnGlobalWeatherClick() {
|
|
|
|
+ if (GlobalData.qXZDatas.Count < 1 || GlobalData.sWZDatas.Count < 1)
|
|
|
|
+ await HttpHelper._Instance.InitGCJKData();
|
|
|
|
+
|
|
|
|
+ GameObject shaPan = GameObject.FindGameObjectWithTag("ShaPan");
|
|
|
|
+ CameraManager.SwitchCamera(1);
|
|
|
|
+ if (dropUnits.Count <= 0)
|
|
|
|
+ {
|
|
|
|
+ viewMode = ViewMode.miniMap;
|
|
|
|
+ dropUnits = new List<DropUnit>();
|
|
|
|
+ weatherUnits = new List<WeatherUnit>();
|
|
|
|
+ for (int i = 0; i < GlobalData.qXZDatas.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ GameObject gameObject = Instantiate(dropUnitPrefab);
|
|
|
|
+ DropUnit dropUnit = gameObject.GetComponent<DropUnit>();
|
|
|
|
+ dropUnit.transform.SetParent(miniMapQXContent.transform);
|
|
|
|
+ dropUnit.Init(GlobalData.qXZDatas[i].LGTD, GlobalData.qXZDatas[i].LTTD, GlobalData.qXZDatas[i].STNM, GlobalData.qXZDatas[i].dropSum6.ToString());
|
|
|
|
+ dropUnits.Add(dropUnit);
|
|
|
|
+
|
|
|
|
+ dropUnit.bingObj = Instantiate(runtimePointObj).gameObject;
|
|
|
|
+ dropUnit.bingObj.transform.SetParent(shaPan.transform.GetChild(7));
|
|
|
|
+ dropUnit.bingObj.transform.localEulerAngles = Vector3.zero;
|
|
|
|
+ dropUnit.bingObj.transform.localScale = Vector3.one;
|
|
|
|
+ dropUnit.bingObj.transform.localPosition = CoordinateConverter.GeoToUGUISmall(GlobalData.qXZDatas[i].LGTD, GlobalData.qXZDatas[i].LTTD);
|
|
|
|
+ dropUnit.bingObj.name = GlobalData.qXZDatas[i].STNM;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < GlobalData.sWZDatas.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ GameObject gameObject = Instantiate(dropUnitPrefab);
|
|
|
|
+ DropUnit dropUnit = gameObject.GetComponent<DropUnit>();
|
|
|
|
+ dropUnit.transform.SetParent(miniMapSWContent.transform);
|
|
|
|
+ dropUnit.Init(GlobalData.sWZDatas[i].LGTD, GlobalData.sWZDatas[i].LTTD, GlobalData.sWZDatas[i].STNM, GlobalData.sWZDatas[i].dropSum6.ToString());
|
|
|
|
+ dropUnits.Add(dropUnit);
|
|
|
|
+
|
|
|
|
+ dropUnit.bingObj = Instantiate(runtimePointObj).gameObject;
|
|
|
|
+ dropUnit.bingObj.transform.SetParent(shaPan.transform.GetChild(8));
|
|
|
|
+ dropUnit.bingObj.transform.localEulerAngles = Vector3.zero;
|
|
|
|
+ dropUnit.bingObj.transform.localScale = Vector3.one;
|
|
|
|
+ dropUnit.bingObj.transform.localPosition = CoordinateConverter.GeoToUGUISmall(GlobalData.sWZDatas[i].LGTD, GlobalData.sWZDatas[i].LTTD);
|
|
|
|
+ dropUnit.bingObj.name = GlobalData.sWZDatas[i].STNM;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ viewMode = ViewMode.miniMap;
|
|
|
|
+ int index = 0;
|
|
|
|
+ for (int i = 0; i < GlobalData.qXZDatas.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ dropUnits[i].Init(GlobalData.qXZDatas[i].LGTD, GlobalData.qXZDatas[i].LTTD, GlobalData.qXZDatas[i].STNM, GlobalData.qXZDatas[i].dropSum6.ToString());
|
|
|
|
+ index++;
|
|
|
|
+ }
|
|
|
|
+ for (int i = 0; i < GlobalData.sWZDatas.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ dropUnits[i + index].Init(GlobalData.sWZDatas[i].LGTD, GlobalData.sWZDatas[i].LTTD, GlobalData.sWZDatas[i].STNM, GlobalData.sWZDatas[i].dropSum6.ToString());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (weatherUnits.Count <= 0)
|
|
|
|
+ {
|
|
|
|
+ for (int i = 0; i < GlobalData.sWZDatas.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ GameObject gameObject = Instantiate(weatherUnitPrefab);
|
|
|
|
+ WeatherUnit weatherUnit = gameObject.GetComponent<WeatherUnit>();
|
|
|
|
+ weatherUnit.transform.SetParent(miniMapSWContent.transform);
|
|
|
|
+ weatherUnit.Init(GlobalData.sWZDatas[i].LGTD, GlobalData.sWZDatas[i].LTTD, GlobalData.sWZDatas[i].STNM, GlobalData.sWZDatas[i].wth);
|
|
|
|
+ weatherUnits.Add(weatherUnit);
|
|
|
|
+
|
|
|
|
+ weatherUnit.bingObj = Instantiate(runtimePointObj).gameObject;
|
|
|
|
+ weatherUnit.bingObj.transform.SetParent(shaPan.transform.GetChild(8));
|
|
|
|
+ weatherUnit.bingObj.transform.localEulerAngles = Vector3.zero;
|
|
|
|
+ weatherUnit.bingObj.transform.localScale = Vector3.one;
|
|
|
|
+ weatherUnit.bingObj.transform.localPosition = CoordinateConverter.GeoToUGUISmall(GlobalData.sWZDatas[i].LGTD, GlobalData.sWZDatas[i].LTTD);
|
|
|
|
+ weatherUnit.bingObj.name = GlobalData.sWZDatas[i].STNM;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ for (int i = 0; i < GlobalData.sWZDatas.Count; i++)
|
|
|
|
+ {
|
|
|
|
+ weatherUnits[i].Init(GlobalData.sWZDatas[i].LGTD, GlobalData.sWZDatas[i].LTTD, GlobalData.sWZDatas[i].STNM, GlobalData.sWZDatas[i].wth);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ miniMap.gameObject.SetActive(true);
|
|
|
|
+ main.gameObject.SetActive(false);
|
|
|
|
+ }
|
|
|
|
+
|
|
public void SetBengZhanJianKongData(BengZhanJianKongData[] datas)
|
|
public void SetBengZhanJianKongData(BengZhanJianKongData[] datas)
|
|
{
|
|
{
|
|
for (int i = 0; i < currentBengZhanJianKongItems.Count; i++)
|
|
for (int i = 0; i < currentBengZhanJianKongItems.Count; i++)
|