Browse Source

7/28更新

2025/7/28 修改Home场景狗碰撞后弹开只在IDLE状态下发生
调整Webcontroller显示结果和回调函数的顺序
Jees 2 days ago
parent
commit
bc5191ea77

+ 1 - 1
Assets/Scripts/Functions/WebController.cs

@@ -107,8 +107,8 @@ public class WebController : MonoBehaviour
                     }
                 }
                 // 上传成功,获取服务器响应
-                callback?.Invoke(responseText);
                 Debug.Log("上传成功!服务器响应: " + responseText);
+                callback?.Invoke(responseText);
             }
         }
     }

+ 2 - 3
Assets/Scripts/Home/DogCollisionController.cs

@@ -38,10 +38,9 @@ public class DogCollisionController : MonoBehaviour
 
             foreach (var dog in HomeController.dogsInScene)
             {
-                if (dog.gameObject == thisDog && dog.dogState != DogState.SLEEP)
+                if (dog.gameObject == thisDog && dog.dogState == DogState.IDLE)
                 {
-                    // 如果狗正在睡觉,则不处理碰撞
-                    // 只处理非睡觉状态下的碰撞
+                    // 只处理狗在Idle状态下的碰撞
                     Debug.Log("dog move to location" + moveToLocation);
                     {
                         dog.moveToLocation = moveToLocation;

+ 2 - 0
Assets/Scripts/Home/HomeController.cs

@@ -481,6 +481,7 @@ public class HomeController : MonoBehaviour
             float highestScore = 0;
             string highestScoreDogId = String.Empty;
             var scores = data["call Score MFCC"].ToString();
+            // var scores = data["call Score Xunfei"].ToString();
             var scoresList = JsonConvert.DeserializeObject<Dictionary<string, float>>(scores);
             foreach (var score in scoresList)
             {
@@ -598,6 +599,7 @@ public class HomeController : MonoBehaviour
                 float highestScore = 0;
                 string highestScoreCommand = "";
                 string scores = data["commandScoreMFCC"].ToString();
+                // string scores = data["commandScoreXunfei"].ToString();
                 var scoresList = JsonConvert.DeserializeObject<Dictionary<string, float>>(scores);
                 foreach (var score in scoresList)
                 {