|
@@ -32,7 +32,8 @@ public enum LayerUnitType
|
|
|
}
|
|
|
|
|
|
[System.Serializable]
|
|
|
-public class JKYJData {
|
|
|
+public class JKYJData
|
|
|
+{
|
|
|
public int normal;
|
|
|
public int total;
|
|
|
public int fault;
|
|
@@ -50,7 +51,7 @@ public class JKYJChildData
|
|
|
public bool onlineStatus;
|
|
|
}
|
|
|
|
|
|
- public class GCGKData
|
|
|
+public class GCGKData
|
|
|
{
|
|
|
public string name;
|
|
|
public string type;
|
|
@@ -234,7 +235,8 @@ public class YZTLayer : YZTRootLayer
|
|
|
|
|
|
}
|
|
|
|
|
|
- async void InitGCGKData() {
|
|
|
+ async void InitGCGKData()
|
|
|
+ {
|
|
|
await new WaitUntil(() =>
|
|
|
{
|
|
|
return GlobalData.gcgkContents.Count > 2;
|
|
@@ -247,18 +249,19 @@ public class YZTLayer : YZTRootLayer
|
|
|
|
|
|
async void InitJKYJData()
|
|
|
{
|
|
|
- // Debug.Log("111");
|
|
|
+ // Debug.Log("111");
|
|
|
await new WaitUntil(() =>
|
|
|
{
|
|
|
return GlobalData.byJKYJContents.total > 0 && GlobalData.tkJKYJContents.total > 0;
|
|
|
});
|
|
|
//Debug.Log("222");
|
|
|
- for (int i = 0; i < GlobalData.byJKYJContents.items.Count; i++) {
|
|
|
+ for (int i = 0; i < GlobalData.byJKYJContents.items.Count; i++)
|
|
|
+ {
|
|
|
Thing0 thing0 = Instantiate(thing0Prefab);
|
|
|
thing0.transform.SetParent(thing0Content);
|
|
|
thing0.transform.localPosition = Vector3.zero;
|
|
|
thing0.transform.localScale = Vector3.one;
|
|
|
- thing0.SetData(i.ToString(), GlobalData.byJKYJContents.items[i].name, "补元", "开启", GlobalData.byJKYJContents.items[i].onlineStatus?"正常":"故障");
|
|
|
+ thing0.SetData(i.ToString(), GlobalData.byJKYJContents.items[i].name, "补元", "开启", GlobalData.byJKYJContents.items[i].onlineStatus ? "正常" : "故障");
|
|
|
}
|
|
|
//Debug.Log("333");
|
|
|
for (int i = 0; i < GlobalData.tkJKYJContents.items.Count; i++)
|
|
@@ -269,7 +272,7 @@ public class YZTLayer : YZTRootLayer
|
|
|
thing0.transform.localScale = Vector3.one;
|
|
|
thing0.SetData((i + GlobalData.byJKYJContents.total).ToString(), GlobalData.tkJKYJContents.items[i].name, "套口", "开启", GlobalData.tkJKYJContents.items[i].onlineStatus ? "正常" : "故障");
|
|
|
}
|
|
|
- // Debug.Log("444");
|
|
|
+ // Debug.Log("444");
|
|
|
totalJKNum.text = (GlobalData.byJKYJContents.total + GlobalData.tkJKYJContents.total).ToString();
|
|
|
normalJKNum.text = (GlobalData.byJKYJContents.normal + GlobalData.tkJKYJContents.normal).ToString();
|
|
|
errorJKNum.text = (GlobalData.byJKYJContents.fault + GlobalData.tkJKYJContents.fault).ToString();
|
|
@@ -756,36 +759,15 @@ public class YZTLayer : YZTRootLayer
|
|
|
void InitPoint()
|
|
|
{
|
|
|
GameObject shaPan = GameObject.FindGameObjectWithTag("ShaPan");
|
|
|
+ List<Item0> item0s = new List<Item0>();
|
|
|
for (int i = 0; i < GlobalData.hotPointDatas.Count; i++)
|
|
|
{
|
|
|
|
|
|
HotPointData temp = GlobalData.hotPointDatas[i];
|
|
|
Vector3 tempLocalPosition = CoordinateConverter.GeoToUGUISmall(temp.longitude, temp.latitude);
|
|
|
- //bool have = false;
|
|
|
- //for (int j = 0; j < runtimePointLib.Count; j++)
|
|
|
- //{
|
|
|
- // if (Vector3.Distance(tempLocalPosition, runtimePointLib[j].bingObj.transform.localPosition) < 0.1)
|
|
|
- // {
|
|
|
- // if (runtimePointLib[j].layerIDs.Contains((int)temp.type))
|
|
|
- // {
|
|
|
- // have = true;
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // else {
|
|
|
- // have = true;
|
|
|
- // runtimePointLib[j].Refresh(hotPointSprite[8]);
|
|
|
- // runtimePointLib[j].layerIDs.Add((int)temp.type);
|
|
|
-
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // }
|
|
|
- //}
|
|
|
- //if (have) {
|
|
|
- // continue;
|
|
|
- //}
|
|
|
|
|
|
RuntimePoint newPoint = Instantiate(pointPrefab, Vector3.zero, Quaternion.identity);
|
|
|
-
|
|
|
+
|
|
|
int tempI = i;
|
|
|
newPoint.GetComponent<RectTransform>().SetParent(pointParent);
|
|
|
newPoint.InitPoint(hotPointSprite[(int)(temp.type)], temp.namePri, temp.name);
|
|
@@ -800,30 +782,38 @@ public class YZTLayer : YZTRootLayer
|
|
|
if ((int)temp.type == 6 || (int)temp.type == 7)
|
|
|
{
|
|
|
int index = FindIndexByLayerUnitName(temp.name);
|
|
|
-
|
|
|
+
|
|
|
Item0 item0 = Instantiate(item0Prefab, Vector3.zero, Quaternion.identity);
|
|
|
- item0.GetComponent<RectTransform>().SetParent(item0Parent.transform);
|
|
|
item0.InitPoint(hotPointSprite[(int)(temp.type)], temp.namePri, temp.name, GlobalData.layerUnitDatas[index].special);
|
|
|
+ item0s.Add(item0);
|
|
|
item0.onPointClick = () =>
|
|
|
{
|
|
|
OnNewPointClick(temp, item0);
|
|
|
};
|
|
|
}
|
|
|
-
|
|
|
- Item0 item1 = Instantiate(item0Prefab, Vector3.zero, Quaternion.identity);
|
|
|
- item1.GetComponent<RectTransform>().SetParent(item0Parent.transform);
|
|
|
- item1.InitPoint(hotPointSprite[7], "GeTi", "隔提", "1");
|
|
|
- //item1.onPointClick = () =>
|
|
|
- //{
|
|
|
- // OnNewPointClick(temp, item1);
|
|
|
- //};
|
|
|
-
|
|
|
newPoint.onPointClick = () =>
|
|
|
{
|
|
|
OnNewPointClick(temp, newPoint);
|
|
|
};
|
|
|
runtimePointLib.Add(newPoint);
|
|
|
}
|
|
|
+
|
|
|
+ for (int i = 0; i < item0s.Count; i++)
|
|
|
+ {
|
|
|
+ if (item0s[i].mSpecial != "1")
|
|
|
+ item0s[i].GetComponent<RectTransform>().SetParent(item0Parent.transform);
|
|
|
+ }
|
|
|
+
|
|
|
+ for (int i = 0; i < item0s.Count; i++)
|
|
|
+ {
|
|
|
+ if (item0s[i].mSpecial == "1")
|
|
|
+ item0s[i].GetComponent<RectTransform>().SetParent(item0Parent.transform);
|
|
|
+ }
|
|
|
+
|
|
|
+ Item0 item1 = Instantiate(item0Prefab, Vector3.zero, Quaternion.identity);
|
|
|
+ item1.GetComponent<RectTransform>().SetParent(item0Parent.transform);
|
|
|
+ item1.InitPoint(hotPointSprite[7], "GeTi", "隔提", "1");
|
|
|
+
|
|
|
RunTimeLayerClick(0);
|
|
|
RunTimeLayerClick(1);
|
|
|
RunTimeLayerClick(2);
|
|
@@ -832,7 +822,7 @@ public class YZTLayer : YZTRootLayer
|
|
|
RunTimeLayerClick(5);
|
|
|
RunTimeLayerClick(6);
|
|
|
|
|
|
- BaseLayer3BtnOnClick(true);
|
|
|
+ BaseLayer0BtnOnClick(true);
|
|
|
}
|
|
|
|
|
|
int FindIndexByLayerUnitName(string name)
|
|
@@ -1072,7 +1062,7 @@ public class YZTLayer : YZTRootLayer
|
|
|
lakeLayerInfo[i].anchoredPosition = CameraManager.instance.secondCamera.WorldToScreenPoint(lakeLayerObj[i].transform.position) / Screen.width * 1920.0f;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|