Parcourir la source

修复一些bug

ZXP il y a 1 an
Parent
commit
5aa525a19a

+ 3 - 3
Assets/Prefabs/SelectPrefab.prefab

@@ -113,7 +113,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: 4948.9, y: -1286.4}
+  m_AnchoredPosition: {x: 4990.5, y: -1284.9}
   m_SizeDelta: {x: 244, y: 686.73}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &4063908967862322276
@@ -404,8 +404,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: 4948.9, y: -1286.42}
-  m_SizeDelta: {x: 244, y: 686.73}
+  m_AnchoredPosition: {x: 4990, y: -1284}
+  m_SizeDelta: {x: 243, y: 685}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &5943149762659415357
 CanvasRenderer:

+ 1 - 17
Assets/Prefabs/WorldCanvas.prefab

@@ -1497,7 +1497,7 @@ MonoBehaviour:
   m_FallbackScreenDPI: 96
   m_DefaultSpriteDPI: 96
   m_DynamicPixelsPerUnit: 1
-  m_PresetInfoIsWorld: 0
+  m_PresetInfoIsWorld: 1
 --- !u!114 &4400771669138867728
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -19970,22 +19970,6 @@ PrefabInstance:
       propertyPath: animator
       value: 
       objectReference: {fileID: 0}
-    - target: {fileID: 5943149762659415358, guid: 403675a57c95abc4a8b2fbbf2e09f862, type: 3}
-      propertyPath: m_SizeDelta.x
-      value: 243
-      objectReference: {fileID: 0}
-    - target: {fileID: 5943149762659415358, guid: 403675a57c95abc4a8b2fbbf2e09f862, type: 3}
-      propertyPath: m_SizeDelta.y
-      value: 685
-      objectReference: {fileID: 0}
-    - target: {fileID: 5943149762659415358, guid: 403675a57c95abc4a8b2fbbf2e09f862, type: 3}
-      propertyPath: m_AnchoredPosition.x
-      value: 4990
-      objectReference: {fileID: 0}
-    - target: {fileID: 5943149762659415358, guid: 403675a57c95abc4a8b2fbbf2e09f862, type: 3}
-      propertyPath: m_AnchoredPosition.y
-      value: -1284
-      objectReference: {fileID: 0}
     - target: {fileID: 5943149762888284033, guid: 403675a57c95abc4a8b2fbbf2e09f862, type: 3}
       propertyPath: m_SizeDelta.x
       value: 4548.8

+ 1 - 1
Assets/Scripts/PlayList.cs

@@ -77,7 +77,7 @@ public class PlayList : MonoBehaviour
         SelectPrefab selectPrefab = obj.GetComponent<SelectPrefab>();
         if (selectPrefab == null)
         {
-            waitTime = obj.GetComponent<AudioSource>().clip.length;
+            waitTime = obj.GetComponent<AudioSource>().clip.length + 2;
         }
         else
         {

+ 8 - 0
Assets/Scripts/SelectPrefab.cs

@@ -54,10 +54,15 @@ public class SelectPrefab : MonoBehaviour
     private Action<bool> selectCallBack;
     private ToggleGroup toggleGroup;
     private bool isRight;
+    /// <summary>
+    /// ÌâÄ¿ÒôƵÎļþ
+    /// </summary>
+    private AudioSource audioSource;
     private void Awake()
     {
         selectButton.onClick.AddListener(SelectButtonOnClick);
         closeButton.onClick.AddListener(CloseButtonOnClick);
+        audioSource = GetComponent<AudioSource>();
         toggleGroup = GetComponent<ToggleGroup>();
     }
     private void Start()
@@ -101,6 +106,8 @@ public class SelectPrefab : MonoBehaviour
     /// </summary>
     private void SelectButtonOnClick()
     {
+        text.gameObject.SetActive(false);
+        audioSource.enabled = false;
         if (textActive)
         {
             closeButton.gameObject.SetActive(true);
@@ -147,6 +154,7 @@ public class SelectPrefab : MonoBehaviour
     {
         selectCallBack = callBack;
         text.gameObject.SetActive(true);
+        audioSource.enabled = true;
         trueText1.gameObject.SetActive(false);
         falseText1.gameObject.SetActive(false);
         trueText2.gameObject.SetActive(false);

+ 2 - 2
Assets/StudentAnimator.cs

@@ -9,13 +9,13 @@ public class StudentAnimator : MonoBehaviour
     private void OnEnable()
     {
         cameraSet.transform.localPosition = new Vector3(0, 1.2f, 6);
-        cameraSet.transform.localPosition = new Vector3(0, 180, 6);
+        cameraSet.transform.localEulerAngles = new Vector3(0, 180, 0);
         animator.SetBool("IsPlay", true);
     }
     private void OnDisable()
     {
         cameraSet.transform.localPosition = new Vector3(0, 1.2f, 0);
-        cameraSet.transform.localEulerAngles = new Vector3(0, 180, 0);
+        cameraSet.transform.localEulerAngles = new Vector3(0, 0, 0);
         animator.SetBool("IsPlay", true);
     }
 }

粤ICP备19079148号