wartheking před 9 měsíci
rodič
revize
ef8cd7c103

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 3 - 180
Assets/Scene 1.unity


+ 30 - 30
Assets/Scripts/UI/UIView/YZT/RuntimePoint.cs

@@ -53,37 +53,37 @@ public class RuntimePoint : MonoBehaviour, IPointerDownHandler, IPointerUpHandle
     // Start is called before the first frame update
     void Start()
     {
-        this.GetComponent<Button>().onClick.AddListener(() =>
-        {
-            if (layerIDs.Count > 1)
-            {
-                addContent.gameObject.SetActive(true);
-                if (listBtns.Count < 1)
-                {
-                    for (int i = 0; i < layerIDs.Count; i++)
-                    {
-                        Button button = Instantiate(childBtnPrefab);
-                        button.GetComponent<RectTransform>().SetParent(childBtnParent);
-                        int temp = i;
-                        button.GetComponentInChildren<Text>().text = childBtnNames[layerIDs[i]];
-                        button.transform.localScale = Vector3.one;
-                        button.gameObject.SetActive(true);
+        //this.GetComponent<Button>().onClick.AddListener(() =>
+        //{
+        //    if (layerIDs.Count > 1)
+        //    {
+        //        addContent.gameObject.SetActive(true);
+        //        if (listBtns.Count < 1)
+        //        {
+        //            for (int i = 0; i < layerIDs.Count; i++)
+        //            {
+        //                Button button = Instantiate(childBtnPrefab);
+        //                button.GetComponent<RectTransform>().SetParent(childBtnParent);
+        //                int temp = i;
+        //                button.GetComponentInChildren<Text>().text = childBtnNames[layerIDs[i]];
+        //                button.transform.localScale = Vector3.one;
+        //                button.gameObject.SetActive(true);
                         
-                        button.onClick.AddListener(() =>
-                        {
-                            onChildClick?.Invoke(layerIDs[temp],this);
-                            Debug.Log(layerIDs[temp]);
-                            addContent.gameObject.SetActive(false);
-                        });
-                        listBtns.Add(button);
-                    }
-                }
-            }
-            CameraManager.instance.secondCamera.GetComponent<CameraBirdSec>().beginDrag += () =>
-            {
-                addContent.gameObject.SetActive(false);
-            };
-        });
+        //                button.onClick.AddListener(() =>
+        //                {
+        //                    onChildClick?.Invoke(layerIDs[temp],this);
+        //                    Debug.Log(layerIDs[temp]);
+        //                    addContent.gameObject.SetActive(false);
+        //                });
+        //                listBtns.Add(button);
+        //            }
+        //        }
+        //    }
+        //    CameraManager.instance.secondCamera.GetComponent<CameraBirdSec>().beginDrag += () =>
+        //    {
+        //        addContent.gameObject.SetActive(false);
+        //    };
+        //});
     }
     public void Refresh(Sprite newIcon) {
         Debug.Log(newIcon);

+ 16 - 44
Assets/Scripts/UI/UIView/YZT/YZTLayer.cs

@@ -174,6 +174,7 @@ public class YZTLayer : YZTRootLayer
             {
                 clearBtn.GetComponent<Image>().sprite = sprites[1];
                 leftContent.gameObject.SetActive(false);
+                pointParent.gameObject.SetActive(false);
                 middleContent.gameObject.SetActive(false);
                 rightContent.gameObject.SetActive(false);
                 clearBtn.GetComponent<RectTransform>().anchoredPosition = new Vector2(-827, clearBtn.GetComponent<RectTransform>().anchoredPosition.y);
@@ -181,6 +182,7 @@ public class YZTLayer : YZTRootLayer
             else {
                 clearBtn.GetComponent<Image>().sprite = sprites[0];
                 leftContent.gameObject.SetActive(true);
+                pointParent.gameObject.SetActive(true);
                 middleContent.gameObject.SetActive(true);
                 rightContent.gameObject.SetActive(true);
                 clearBtn.GetComponent<RectTransform>().anchoredPosition = new Vector2(-457, clearBtn.GetComponent<RectTransform>().anchoredPosition.y);
@@ -394,6 +396,8 @@ public class YZTLayer : YZTRootLayer
                             StaticLod.instance.OnFoucusStatic(tempDatas[tempJ].name_pri);
                             yZT.gameObject.SetActive(true);
                             ChangeRightContent(tempJ);
+                            pointParent.gameObject.SetActive(false);
+                            clearBtn.gameObject.SetActive(false);
                             middleContent.gameObject.SetActive(false);
                             rightContent.gameObject.SetActive(false);
                             LeftBtnClick(1, false);
@@ -420,6 +424,8 @@ public class YZTLayer : YZTRootLayer
                             StaticLod.instance.OnFoucusStatic(tempDatas[tempJ].name_pri);
                             yZT.gameObject.SetActive(true);
                             ChangeRightContent(tempJ);
+                            pointParent.gameObject.SetActive(false);
+                            clearBtn.gameObject.SetActive(false);
                             middleContent.gameObject.SetActive(false);
                             rightContent.gameObject.SetActive(false);
                             LeftBtnClick(1, false);
@@ -519,43 +525,14 @@ public class YZTLayer : YZTRootLayer
             newPoint.bingObj.transform.localPosition = tempLocalPosition;
             newPoint.bingObj.name = temp.name;
 
-            newPoint.onChildClick += OnChooseNewPointClick;
-
             newPoint.onPointClick = () =>
             {
-                OnChooseNewPointClick(temp, newPoint);
+                OnNewPointClick(temp, newPoint);
             };
             runtimePointLib.Add(newPoint);
         }
     }
 
-    void OnChooseNewPointClick(int selectIndex, RuntimePoint newPoint) {
-        if (selectIndex == 0 || selectIndex == 3 || selectIndex == 5)
-        {
-            OnePicNav.instance.OnButtnClick(2);
-        }
-        else if (selectIndex == 1 || selectIndex == 2)
-        {
-            OnePicNav.instance.SwitchToGlobalWeather();
-        }
-        else if (selectIndex == 4)
-        {
-            OnePicNav.instance.SwitchToGlobalWaterHeight();
-        }
-        else if (selectIndex >= 6)
-        {
-            CameraManager.SwitchCamera(0);
-            viewMode = ViewMode.normal;
-            StaticLod.instance.OnFoucusStatic(newPoint.staticImp);
-            yZT.gameObject.SetActive(true);
-            int index = FindIndexByLayerUnitName(newPoint.bingObj.gameObject.name);
-            ChangeRightContent(index);
-            middleContent.gameObject.SetActive(false);
-            rightContent.gameObject.SetActive(false);
-            LeftBtnClick(1, false);
-        }
-    }
-
     int FindIndexByLayerUnitName(string name) {
         for (int i = 0; i < GlobalData.layerUnitDatas.Count; i++) {
             if (GlobalData.layerUnitDatas[i].name == name.Trim()) {
@@ -565,33 +542,24 @@ public class YZTLayer : YZTRootLayer
         return -1;
     }
 
-    void OnChooseNewPointClick(HotPointData temp, RuntimePoint newPoint) {
-        if (newPoint.layerIDs.Count < 2)
-        {
-            OnNewPointClick(temp, newPoint);
-        }
-    }
 
     void OnNewPointClick(HotPointData temp, RuntimePoint newPoint)
     {
-        if ((int)temp.type == 0 || (int)temp.type == 3 || (int)temp.type == 5) {
-            OnePicNav.instance.OnButtnClick(2);
-        } 
-        else if ((int)temp.type == 1 || (int)temp.type == 2) {
-            OnePicNav.instance.SwitchToGlobalWeather();
-        }
-        else if ((int)temp.type == 4)
+        if ((int)temp.type == 4)
         {
             OnePicNav.instance.SwitchToGlobalWaterHeight();
         }
-        else if ((int)temp.type >= 6)
+        else if ((int)temp.type >= 6 || newPoint.layerIDs.Count > 4)
         {
+            Debug.Log(1111111111111);
             CameraManager.SwitchCamera(0);
             viewMode = ViewMode.normal;
             StaticLod.instance.OnFoucusStatic(newPoint.staticImp);
             yZT.gameObject.SetActive(true);
             int index = FindIndexByLayerUnitName(temp.name);
             ChangeRightContent(index);
+            pointParent.gameObject.SetActive(false);
+            clearBtn.gameObject.SetActive(false);
             middleContent.gameObject.SetActive(false);
             rightContent.gameObject.SetActive(false);
             LeftBtnClick(1, false);
@@ -614,6 +582,8 @@ public class YZTLayer : YZTRootLayer
 
     void Init() {
         yZT.gameObject.SetActive(false);
+        clearBtn.gameObject.SetActive(true);
+        pointParent.gameObject.SetActive(true);
         middleContent.gameObject.SetActive(true);
         rightContent.gameObject.SetActive(true);
         LeftBtnClick(currentActiveLeft);
@@ -688,6 +658,8 @@ public class YZTLayer : YZTRootLayer
                 int index = StaticLod.instance.OnFoucusStatic(si);
                 yZT.gameObject.SetActive(true);
                 ChangeRightContent(index);
+                pointParent.gameObject.SetActive(false);
+                clearBtn.gameObject.SetActive(false);
                 middleContent.gameObject.SetActive(false);
                 rightContent.gameObject.SetActive(false);
                 LeftBtnClick(1,false);

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů