瀏覽代碼

6/4更新

修正遛狗场景分数显示逻辑错误
修正狗从睡眠状态进入交互状态时候,没有去掉ZZZ粒子效果。
Jees 3 天之前
父節點
當前提交
d18de35b00

+ 0 - 14
Assets/Scenes/Login.unity

@@ -2388,7 +2388,6 @@ GameObject:
   - component: {fileID: 963194227}
   - component: {fileID: 963194226}
   - component: {fileID: 963194230}
-  - component: {fileID: 963194229}
   - component: {fileID: 963194233}
   - component: {fileID: 963194234}
   - component: {fileID: 963194235}
@@ -2473,19 +2472,6 @@ Transform:
   m_Children: []
   m_Father: {fileID: 0}
   m_LocalEulerAnglesHint: {x: 10, y: 180, z: 0}
---- !u!114 &963194229
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 963194225}
-  m_Enabled: 0
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 91112a7c65b63a74d9a65234c01d1166, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  sceneId: 3
 --- !u!114 &963194230
 MonoBehaviour:
   m_ObjectHideFlags: 0

+ 60 - 2
Assets/Scenes/WalkDogs.unity

@@ -1031,6 +1031,63 @@ Transform:
   m_Children: []
   m_Father: {fileID: 0}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1001 &900491547
+PrefabInstance:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_Modification:
+    serializedVersion: 3
+    m_TransformParent: {fileID: 0}
+    m_Modifications:
+    - target: {fileID: 8746815213132877900, guid: 60e223b373cd9a347945535b62afe6ed, type: 3}
+      propertyPath: m_Name
+      value: TransitionManager
+      objectReference: {fileID: 0}
+    - target: {fileID: 8965728007412277684, guid: 60e223b373cd9a347945535b62afe6ed, type: 3}
+      propertyPath: m_LocalPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8965728007412277684, guid: 60e223b373cd9a347945535b62afe6ed, type: 3}
+      propertyPath: m_LocalPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8965728007412277684, guid: 60e223b373cd9a347945535b62afe6ed, type: 3}
+      propertyPath: m_LocalPosition.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8965728007412277684, guid: 60e223b373cd9a347945535b62afe6ed, type: 3}
+      propertyPath: m_LocalRotation.w
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 8965728007412277684, guid: 60e223b373cd9a347945535b62afe6ed, type: 3}
+      propertyPath: m_LocalRotation.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8965728007412277684, guid: 60e223b373cd9a347945535b62afe6ed, type: 3}
+      propertyPath: m_LocalRotation.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8965728007412277684, guid: 60e223b373cd9a347945535b62afe6ed, type: 3}
+      propertyPath: m_LocalRotation.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8965728007412277684, guid: 60e223b373cd9a347945535b62afe6ed, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8965728007412277684, guid: 60e223b373cd9a347945535b62afe6ed, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8965728007412277684, guid: 60e223b373cd9a347945535b62afe6ed, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.z
+      value: 0
+      objectReference: {fileID: 0}
+    m_RemovedComponents: []
+    m_RemovedGameObjects: []
+    m_AddedGameObjects: []
+    m_AddedComponents: []
+  m_SourcePrefab: {fileID: 100100000, guid: 60e223b373cd9a347945535b62afe6ed, type: 3}
 --- !u!1 &992489242
 GameObject:
   m_ObjectHideFlags: 0
@@ -1675,7 +1732,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!114 &1607496258
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -1755,7 +1812,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!114 &1658264214
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -1978,3 +2035,4 @@ SceneRoots:
   - {fileID: 1101318003}
   - {fileID: 1607496260}
   - {fileID: 686717306}
+  - {fileID: 900491547}

+ 2 - 2
Assets/Scenes/WalkDogs/ResultPanel.uxml

@@ -1,6 +1,6 @@
 <ui:UXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" noNamespaceSchemaLocation="../../../UIElementsSchema/UIElements.xsd" editor-extension-mode="True">
     <Style src="project://database/Assets/Scenes/WalkDogs/ResultPanel.uss?fileID=7433441132597879392&amp;guid=04f73cd94e38aa549b8fb5997b5c165f&amp;type=3#ResultPanel" />
-    <ui:VisualElement style="flex-grow: initial; flex-shrink: initial; margin-top: 20px;">
+    <ui:VisualElement name="VisualElement" style="flex-grow: initial; flex-shrink: initial; margin-top: 20px;">
         <ui:VisualElement name="VisualElement" class="item label" style="flex-direction: row; flex-shrink: initial; flex-grow: initial; width: initial;">
             <ui:Label text="&lt;Score&gt;" name="scoreLabel" class="label" style="width: 40%; height: auto; color: rgb(0, 75, 1); -unity-font-style: bold; font-size: 20px;" />
             <ui:Label text="10000" name="scoreValue" class="value" style="width: 40%; -unity-font-style: bold; color: rgb(0, 75, 1); font-size: 20px;" />
@@ -31,5 +31,5 @@
             <ui:Label text="10000" name="coinValue" class="value" style="width: 40%; margin-left: 0; color: rgb(255, 223, 0);" />
         </ui:VisualElement>
     </ui:VisualElement>
-    <ui:Button text="&lt;Confirm&gt;" name="confirm" style="flex-grow: 1; flex-direction: row; -unity-font-definition: url(&quot;project://database/Assets/Font/MaoKenZhuYuanTi-MaokenZhuyuanTi-2.ttf?fileID=12800000&amp;guid=50a63638b44907e46a3fa871d63b7d39&amp;type=3#MaoKenZhuYuanTi-MaokenZhuyuanTi-2&quot;); font-size: 18px; -unity-font-style: normal; background-color: rgba(188, 188, 188, 0); width: 50%; align-self: center; border-top-color: rgb(27, 27, 27); border-left-color: rgb(27, 27, 27); border-right-color: rgb(27, 27, 27); border-bottom-color: rgb(27, 27, 27); border-top-width: 1.5px; border-right-width: 1.5px; border-bottom-width: 1.5px; border-left-width: 1.5px; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; -unity-text-outline-color: rgb(27, 27, 27); bottom: 15%; position: absolute;" />
+    <ui:Button text="&lt;Confirm&gt;" name="confirm" style="flex-grow: 1; flex-direction: row; -unity-font-definition: url(&quot;project://database/Assets/Font/MaoKenZhuYuanTi-MaokenZhuyuanTi-2.ttf?fileID=12800000&amp;guid=50a63638b44907e46a3fa871d63b7d39&amp;type=3#MaoKenZhuYuanTi-MaokenZhuyuanTi-2&quot;); font-size: 18px; -unity-font-style: normal; background-color: rgba(188, 188, 188, 0); width: 50%; align-self: center; border-top-color: rgb(27, 27, 27); border-left-color: rgb(27, 27, 27); border-right-color: rgb(27, 27, 27); border-bottom-color: rgb(27, 27, 27); border-top-width: 1.5px; border-right-width: 1.5px; border-bottom-width: 1.5px; border-left-width: 1.5px; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; -unity-text-outline-color: rgb(27, 27, 27); bottom: 22%; position: absolute;" />
 </ui:UXML>

+ 1 - 0
Assets/Scripts/Home/DogInScene.cs

@@ -112,6 +112,7 @@ public class DogInScene //: ScriptableObject
         Debug.Log("SetupInteract:" + this.gameObject.name);
         HomeController.Instance.SetDogsIsTrigger(false);
         DogBarkController.Instance.PlayDogBarkWithDelay(3);    // 狗叫相应一下
+        RemoveZzzParticle();       // 关闭睡觉粒子特效
         if (dogProperty.voiceCall == 10)
         {
             // GameData.isFirstInteraction = false;

+ 2 - 1
Assets/Scripts/WalkDogs/SoundGameController.cs

@@ -54,7 +54,7 @@ public class SoundGameController : MonoBehaviour
     void Update()
     {
         DogStatusUpdate();
-        UpdateAndShowScoreUI();
+        // UpdateAndShowScoreUI();
     }
 
     IEnumerator DogComponentInstaller()
@@ -486,6 +486,7 @@ public class SoundGameController : MonoBehaviour
         walkDogsScoreController.good = goodCount;
         walkDogsScoreController.poor = poorCount;
         walkDogsScoreController.miss = missCount;
+        walkDogsScoreController.ShowScore();
     }
 }
 

+ 4 - 3
Assets/Scripts/WalkDogs/WalkDogsScoreController.cs

@@ -18,9 +18,10 @@ public class WalkDogsScoreController : MonoBehaviour
     private Label scoreValueLabel, maxComboValueLabel, perfectValueLabel, goodValueLabel, poorValueLabel, missValueLabel, coinValueLabel;
 
     private Button confirmButton;
-    void Start()
+    void OnEnable()
     {
         var root = GetComponent<UIDocument>().rootVisualElement;
+        root.style.backgroundColor = new Color(255, 255, 255, 0.25f); // Set background color to white with 50% opacity
         scoreLabel = root.Q<Label>("scoreLabel");
         maxComboLabel = root.Q<Label>("maxComboLabel");
         perfectLabel = root.Q<Label>("perfectLabel");
@@ -46,7 +47,7 @@ public class WalkDogsScoreController : MonoBehaviour
     // Update is called once per frame
     void Update()
     {
-        ScoreDisplay();
+        // ScoreDisplay();
     }
 
     // 读取显示正确的语言
@@ -70,7 +71,7 @@ public class WalkDogsScoreController : MonoBehaviour
         confirmButton.text = textValue;
     }
 
-    void ScoreDisplay()
+    public void ShowScore()
     {
         coin = Mathf.FloorToInt(score / 1000f);
         // Display the score and other statistics in the UI