Эх сурвалжийг харах

提交修复蓄洪调度动画的bug

wartheking 1 долоо хоног өмнө
parent
commit
6b6dbca2f8

+ 5 - 5
Assets/Prefabs/UI/XHYZT/GCJK.prefab

@@ -12266,7 +12266,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &1691322289424107046
 RectTransform:
   m_ObjectHideFlags: 0
@@ -28684,7 +28684,7 @@ MonoBehaviour:
   m_HandleRect: {fileID: 7190838263259899883}
   m_Direction: 2
   m_Value: 0
-  m_Size: 1
+  m_Size: 0.81333333
   m_NumberOfSteps: 0
   m_OnValueChanged:
     m_PersistentCalls:
@@ -37876,7 +37876,7 @@ RectTransform:
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 0, y: 0}
+  m_AnchorMax: {x: 1, y: 0.81333333}
   m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 20, y: 20}
   m_Pivot: {x: 0.5, y: 0.5}
@@ -42973,9 +42973,9 @@ RectTransform:
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 0, y: 0}
+  m_AnchorMax: {x: 1, y: 1}
   m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 0, y: 0}
+  m_SizeDelta: {x: -17, y: 0}
   m_Pivot: {x: 0, y: 1}
 --- !u!222 &4906047764233828022
 CanvasRenderer:

+ 4 - 4
Assets/Prefabs/UI/ZhanDian.prefab

@@ -35,7 +35,7 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 19, y: -31}
+  m_AnchoredPosition: {x: 19, y: -36.49}
   m_SizeDelta: {x: 40, y: 30}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &5077393164671107454
@@ -274,8 +274,8 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 0, y: 1}
-  m_AnchoredPosition: {x: 110, y: -30.5}
-  m_SizeDelta: {x: 70, y: 25}
+  m_AnchoredPosition: {x: 114.01135, y: -30.5}
+  m_SizeDelta: {x: 78.0227, y: 25}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &3930887372748340453
 CanvasRenderer:
@@ -309,7 +309,7 @@ MonoBehaviour:
     m_Font: {fileID: 12800000, guid: 85c13d115126ca04ca985ec0156f4c61, type: 3}
     m_FontSize: 16
     m_FontStyle: 0
-    m_BestFit: 0
+    m_BestFit: 1
     m_MinSize: 1
     m_MaxSize: 40
     m_Alignment: 3

+ 53 - 15
Assets/Scripts/UI/UIView/XHDD/XHDDLayer.cs

@@ -119,7 +119,7 @@ public class XHDDLayer : YZTRootLayer
 
     public string[,] allYAContent = new string[3, 3];
 
-    bool playing = false;
+    public bool playing = false;
 
     float currentTime = 0;
 
@@ -271,7 +271,7 @@ public class XHDDLayer : YZTRootLayer
     public override void OnUILeave()
     {
         base.OnUILeave();
-        AllRestore();
+        OnExitXHDDYS();
     }
 
     void InitYAContent()
@@ -288,6 +288,17 @@ public class XHDDLayer : YZTRootLayer
         allYAContent[2, 1] = "开启套口进洪闸或实施上车湾口门爆破,开始分蓄洪。";
         allYAContent[2, 2] = "红色警报期持续至具备返迁条件时为止。";
     }
+
+    void OnExitXHDDYS()
+    {
+        qxhddContent.gameObject.SetActive(true);
+        xhddContent.gameObject.SetActive(false);
+        playBtn.interactable = true;
+        playBtn.GetComponentInChildren<Text>().text = "开始演示";
+        playing = false;
+        AllRestore();
+    }
+
     void InitButton()
     {
         enterBtn.onClick.AddListener(() =>
@@ -296,14 +307,7 @@ public class XHDDLayer : YZTRootLayer
             xhddContent.gameObject.SetActive(true);
         });
 
-        exitBtn.onClick.AddListener(() =>
-        {
-            qxhddContent.gameObject.SetActive(true);
-            xhddContent.gameObject.SetActive(false);
-            playBtn.interactable = true;
-            playing = false;
-            AllRestore();
-        });
+        exitBtn.onClick.AddListener(OnExitXHDDYS);
 
         for (int i = 0; i < yjButtons.Length; i++)
         {
@@ -323,14 +327,30 @@ public class XHDDLayer : YZTRootLayer
                 yJType = (YJType)temp;
                 yjDropdown.value = temp;
             });
-
         }
 
+        yjDropdown.onValueChanged.AddListener((int value) =>
+        {
+            if (!playing)
+            {
+                ClearAllText();
+            }
+            for (int j = 0; j < yjButtons.Length; j++)
+            {
+                yjButtons[j].GetComponent<CanvasGroup>().alpha = 0.2f;
+
+            }
+            yjButtons[value].GetComponent<CanvasGroup>().alpha = 1f;
+            yJType = (YJType)value;
+        });
+
+
         playBtn.onClick.AddListener(() =>
         {
             ClearAllText();
             playing = true;
             playBtn.interactable = false;
+            playBtn.GetComponentInChildren<Text>().text = "演示中...";
             currentTime = 0;
             ControlYJ();
         });
@@ -340,10 +360,10 @@ public class XHDDLayer : YZTRootLayer
     {
         TimeLineControl.instance.transform.GetChild(1).GetChild(1).localPosition = Vector3.zero;
         TimeLineControl.instance.transform.GetChild(0).gameObject.SetActive(false);
-        TimeLineControl.instance.transform.GetChild(1).GetChild(0).gameObject.SetActive(false);
-        TimeLineControl.instance.transform.GetChild(1).GetChild(1).gameObject.SetActive(false);
+        TimeLineControl.instance.transform.GetChild(2).GetChild(0).gameObject.SetActive(false);
         GameObject.FindGameObjectWithTag("HeMianStatic").transform.GetChild(2).gameObject.SetActive(true);
         Material material = TimeLineControl.instance.transform.GetChild(1).GetChild(0).GetComponent<MeshRenderer>().material;
+        ClearAllText();
         material.SetFloat("_ClipLength", 1);
         currentTime = 0;
     }
@@ -370,6 +390,7 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
                 StaticLod.instance.OnFoucusStatic("Bird1");
@@ -380,6 +401,7 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
                 TimeLineControl.instance.transform.GetChild(1).GetChild(1).DOLocalMove(new Vector3(0, 0, 31.2f), 12.0f);
@@ -390,6 +412,7 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
                 threeStepBtns[1].text = allYAContent[(int)yJType, 1];
@@ -401,10 +424,12 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
                 threeStepBtns[2].text = allYAContent[(int)yJType, 2];
                 playBtn.interactable = true;
+                playBtn.GetComponentInChildren<Text>().text = "开始演示";
                 break;
             case YJType.ORANGE:
                 TimeLineControl.instance.transform.GetChild(1).GetChild(1).localPosition = new Vector3(0, 0, 31.2f);
@@ -417,9 +442,10 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
-                StaticLod.instance.OnFoucusStatic("Bird2");
+                StaticLod.instance.OnFoucusStatic("Bird3");
                 await new WaitUntil(() =>
                 {
                     return currentTime > 3;
@@ -427,6 +453,7 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
                 TimeLineControl.instance.transform.GetChild(0).gameObject.SetActive(true);
@@ -437,10 +464,11 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
                 threeStepBtns[1].text = allYAContent[(int)yJType, 1];
-                StaticLod.instance.OnFoucusStatic("Bird3");
+                //StaticLod.instance.OnFoucusStatic("Bird3");
                 await new WaitUntil(() =>
                 {
                     return currentTime > 14;
@@ -448,10 +476,12 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
                 threeStepBtns[2].text = allYAContent[(int)yJType, 2];
                 playBtn.interactable = true;
+                playBtn.GetComponentInChildren<Text>().text = "开始演示";
                 break;
             case YJType.RED:
                 Material material = TimeLineControl.instance.transform.GetChild(1).GetChild(0).GetComponent<MeshRenderer>().material;
@@ -467,6 +497,7 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
                 StaticLod.instance.OnFoucusStatic("Bird2");
@@ -477,6 +508,7 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
                 StaticLod.instance.OnFoucusStatic("Bird4");
@@ -489,6 +521,7 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
                 await new WaitUntil(() =>
@@ -500,6 +533,7 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
                 threeStepBtns[1].text = allYAContent[(int)yJType, 1];
@@ -510,6 +544,7 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
                 StaticLod.instance.OnFoucusStatic("Bird5");
@@ -521,6 +556,7 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
                 StaticLod.instance.OnFoucusStatic("Bird3");
@@ -532,11 +568,13 @@ public class XHDDLayer : YZTRootLayer
                 if (!playing)
                 {
                     playBtn.interactable = true;
+                    playBtn.GetComponentInChildren<Text>().text = "开始演示";
                     return;
                 }
 
                 threeStepBtns[2].text = allYAContent[(int)yJType, 2];
                 playBtn.interactable = true;
+                playBtn.GetComponentInChildren<Text>().text = "开始演示";
                 break;
         }
     }