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

5/18更新

2025/5/16	修正Home场景睡眠状态下恢复到吃喝时候去除zzz粒子效果
狗如果在移动时候碰到,就会触发另外一只狗移动的功能
隐藏道具使用菜单显示数量的问题
2025/5/17	将邮件格式检测代码统一到GameTool.cs
2025/5/18	优化左侧菜单显示聚焦狗和选中的狗现实逻辑。白底为选中的狗,加大为聚焦的狗。
Jees 2 долоо хоног өмнө
parent
commit
bb53cf7cc4

+ 35 - 1
Assets/Resources/Data/languages.json

@@ -710,7 +710,33 @@
         }
     },
     "warehouseUI": {
-        "//": "warehouseUI页面和ShoppingUI相似。数据共用。"
+        "//": "warehouseUI页面和ShoppingUI相似。数据共用。",
+        "message": {
+            "toy_single": {
+                "en": "Do you want to play <<item_name>> with <<dog_name>>?",
+                "zh-cn": "和<<dog_name>>一起玩<<item_name>>吗?"
+            },
+            "toy_multiple": {
+                "en": "Do you want to play <<item_name>> with all dogs?",
+                "zh-cn": "和所有的狗狗一起玩<<item_name>>吗?"
+            },
+            "food_single": {
+                "en": "Do you want to feed <<dog_name>> with <<item_name>>?",
+                "zh-cn": "要给<<dog_name>>吃<<item_name>>东西吗?"
+            },
+            "food_multiple": {
+                "en": "Do you want to feed all dogs with <<item_name>>?",
+                "zh-cn": "要给所有的狗狗吃<<item_name>>吗?"
+            },
+            "other_single": {
+                "en": "Do you want to use <<item_name>> with <<dog_name>>?",
+                "zh-cn": "要给<<dog_name>>使用<<item_name>>吗?"
+            },
+            "other_multiple": {
+                "en": "Do you want to use <<item_name>>?",
+                "zh-cn": "要使用<<item_name>>吗?"
+            }
+        }
     },
     "playgroundUI": {
         "button": {
@@ -967,6 +993,7 @@
             "food_00001": {
                 "price": 10,
                 "picture": "shopping/pictures/food_00001",
+                "target": "multiple",
                 "short_name": "狗粮",
                 "category": "",
                 "type": "",
@@ -981,6 +1008,7 @@
             "food_00002": {
                 "price": 20,
                 "picture": "shopping/pictures/food_00002",
+                "target": "multiple",
                 "short_name": "狗罐头",
                 "category": "",
                 "type": "",
@@ -995,6 +1023,7 @@
             "food_00003": {
                 "price": 15,
                 "picture": "shopping/pictures/food_00003",
+                "target": "multiple",
                 "short_name": "冻肉干",
                 "category": "",
                 "type": "",
@@ -1009,6 +1038,7 @@
             "water_00001": {
                 "price": 2,
                 "picture": "Shopping/pictures/water_00001",
+                "target": "multiple",
                 "category": "",
                 "type": "",
                 "property": "",
@@ -1022,6 +1052,7 @@
             "water_00002": {
                 "price": 15,
                 "picture": "Shopping/pictures/water_00002",
+                "target": "multiple",
                 "category": "",
                 "type": "",
                 "property": "",
@@ -1037,6 +1068,7 @@
             "toy_00001": {
                 "price": 15,
                 "picture": "Shopping/pictures/toy_00001",
+                "target": "single",
                 "category": "",
                 "type": "",
                 "property": "",
@@ -1052,6 +1084,7 @@
             "other_00001": {
                 "price": 10,
                 "picture": "Shopping/pictures/other_00001",
+                "target": "single",
                 "category": "",
                 "type": "",
                 "property": "",
@@ -1065,6 +1098,7 @@
             "other_00002": {
                 "price": 5,
                 "picture": "Shopping/pictures/other_00002",
+                "target": "single",
                 "category": "",
                 "type": "",
                 "property": "",

+ 4 - 4
Assets/Resources/Dog/AnimatorController/shibaInu/HomeDogAnimatorController.controller

@@ -815,9 +815,9 @@ AnimatorStateTransition:
   m_Mute: 0
   m_IsExit: 0
   serializedVersion: 3
-  m_TransitionDuration: 0.049862567
+  m_TransitionDuration: 0.5
   m_TransitionOffset: 0
-  m_ExitTime: 8.708901e-10
+  m_ExitTime: 0.1
   m_HasExitTime: 0
   m_HasFixedDuration: 1
   m_InterruptionSource: 0
@@ -1535,9 +1535,9 @@ AnimatorStateTransition:
   m_Mute: 0
   m_IsExit: 0
   serializedVersion: 3
-  m_TransitionDuration: 0.030618595
+  m_TransitionDuration: 0.5
   m_TransitionOffset: 0
-  m_ExitTime: 0.0017944714
+  m_ExitTime: 0.1
   m_HasExitTime: 0
   m_HasFixedDuration: 1
   m_InterruptionSource: 0

+ 1 - 1
Assets/Resources/DogSelector/DogSelector.uxml

@@ -1,7 +1,7 @@
 <ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="True">
     <Style src="project://database/Assets/Resources/VoiceAndManu/VoiceAndMenu.uss?fileID=7433441132597879392&amp;guid=ce67c533d6e849b47862283007c81f9a&amp;type=3#VoiceAndMenu" />
     <ui:VisualElement style="flex-grow: 1; background-size: 300% 100%;">
-        <ui:VisualElement name="dogMenu" style="flex-grow: 1; position: absolute; top: 360px; width: auto; height: 150px; flex-direction: row; align-items: center; flex-wrap: nowrap; visibility: visible; display: flex;">
+        <ui:VisualElement name="dogMenu" style="flex-grow: 1; position: absolute; top: auto; width: auto; height: 150px; flex-direction: row; align-items: center; flex-wrap: nowrap; visibility: visible; display: flex; bottom: 15%;">
             <ui:VisualElement name="dogIcon" style="flex-grow: 1; position: relative; background-image: url(&quot;project://database/Assets/Pictures/icon2.png?fileID=585736745&amp;guid=114975168980a5d469ca1980fd07d630&amp;type=3#icon2_8&quot;); height: 40px; width: 40px; margin-left: 15px; visibility: visible;" />
             <ui:VisualElement name="dogList" style="flex-grow: 1; width: auto; position: relative; margin-left: 12px; visibility: hidden; display: flex;">
                 <ui:Label text="Label" name="dog00" class="dogNameLabel" style="width: 100%; -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;); border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; display: flex;" />

+ 21 - 5
Assets/Resources/DogSelector/DogSelectorController.cs

@@ -7,7 +7,7 @@ using UnityEngine.SceneManagement;
 using UnityEngine.UIElements;
 
 /* 本代码用来在某些场景中动态切换选择的狗
- * 本代码挂载在 Dog Selector pre feb 下
+ * 本代码挂载在 Dog Selector prefeb 下
  */
 
 public class DogSelectorController : MonoBehaviour
@@ -40,10 +40,10 @@ public class DogSelectorController : MonoBehaviour
     }
 
     // Update is called once per frame
-    //void Update()
-    //{
-
-    //}
+    void Update()
+    {
+        DogNameDisplayEffect();     // 根据FocusDog调整显示效果
+    }
 
     // 初始化狗的名字
     IEnumerator DogNameInit()
@@ -89,4 +89,20 @@ public class DogSelectorController : MonoBehaviour
         // 重新加载当前场景
         SceneManager.LoadScene(currentSceneName);
     }
+
+    // 根据FocusDog调整显示效果
+    void DogNameDisplayEffect()
+    {
+        for (int i = 0; i < UserProperty.dogs.Count; i++)
+        {
+            if (i == GameData.focusDog)
+            {
+                dogNames[i].style.backgroundColor = new Color(180, 250, 120, 180);
+            }
+            else
+            {
+                dogNames[i].style.backgroundColor = new Color(255, 255, 255, 0);
+            }
+        }
+    }
 }

+ 2 - 2
Assets/Resources/Item/Materials/frisbee/Blue.mat

@@ -20,7 +20,7 @@ Material:
   m_CorrespondingSourceObject: {fileID: 0}
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
-  m_Name: Yellow
+  m_Name: Blue
   m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
   m_Parent: {fileID: 0}
   m_ModifiedSerializedProperties: 0
@@ -131,7 +131,7 @@ Material:
     - _ZWrite: 1
     m_Colors:
     - _BaseColor: {r: 0.08627445, g: 0.5143016, b: 0.96078426, a: 0.78431374}
-    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _Color: {r: 0.08627441, g: 0.51430154, b: 0.96078426, a: 0.78431374}
     - _EmissionColor: {r: 0, g: 0, b: 0, a: 0}
     - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
   m_BuildTextureStacks: []

+ 1 - 15
Assets/Resources/UserInfo/UserInfoController.cs

@@ -217,7 +217,7 @@ public class UserInfoController : MonoBehaviour
                 errorText += errorMessageDict["email_is_empty"];
                 errorText += "<br>";
             }
-            else if (!IsValidEmail(email.value))
+            else if (!GameTool.IsValidEmail(email.value))
             {
                 errorText += errorMessageDict["email_format_wrong"];
                 errorText += "<br>";
@@ -235,19 +235,5 @@ public class UserInfoController : MonoBehaviour
             return false;
         }
     }
-
-    // email 格式检测
-    private bool IsValidEmail(string email)
-    {
-        try
-        {
-            var addr = new MailAddress(email);
-            return addr.Address == email;
-        }
-        catch
-        {
-            return false;
-        }
-    }
     #endregion
 }

+ 12 - 4
Assets/Resources/VoiceAndManu/MenuController.cs

@@ -106,7 +106,7 @@ public class MenuController : MonoBehaviour
     void FixedUpdate()
     {
         CollapseMenuCheck();        // 定时收起菜单
-        ScaleDogName();         // 放大缩小选中狗的名字
+        DogNameDisplayEffect();         // 放大缩小选中狗的名字
     }
 
     #region 右侧按键控制
@@ -331,10 +331,9 @@ public class MenuController : MonoBehaviour
         }
     }
 
-    // 调整狗的名字大小
-    void ScaleDogName()
+    // 根据摄像机聚焦和FocusDog调整显示效果
+    void DogNameDisplayEffect()
     {
-
         for (int i = 0; i < UserProperty.dogs.Count; i++)
         {
             if (i == GameData.homeCamFocusDog)
@@ -345,6 +344,15 @@ public class MenuController : MonoBehaviour
             {
                 dogNames[i].transform.scale = new Vector2(1f, 1f);
             }
+
+            if (i == GameData.focusDog)
+            {
+                dogNames[i].style.backgroundColor = new Color(180, 250, 120, 180);
+            }
+            else
+            {
+                dogNames[i].style.backgroundColor = new Color(255, 255, 255, 0);
+            }
         }
     }
     #endregion

+ 5 - 5
Assets/Resources/VoiceAndManu/VoiceAndMenu.uss

@@ -14,11 +14,11 @@
 
 .dogNameLabel {
     -unity-font-definition: url("project://database/Assets/Font/MaoKenZhuYuanTi-MaokenZhuyuanTi-2.ttf?fileID=12800000&guid=50a63638b44907e46a3fa871d63b7d39&type=3#MaoKenZhuYuanTi-MaokenZhuyuanTi-2");
-    background-color: rgba(255, 252, 90, 0.2);
-    border-left-color: rgba(185, 250, 120, 0.69);
-    border-right-color: rgba(185, 250, 120, 0.69);
-    border-top-color: rgba(185, 250, 120, 0.69);
-    border-bottom-color: rgba(185, 250, 120, 0.69);
+    background-color: rgba(227, 255, 198, 0.53);
+    border-left-color: rgba(185, 250, 120, 0.71);
+    border-right-color: rgba(185, 250, 120, 0.71);
+    border-top-color: rgba(185, 250, 120, 0.71);
+    border-bottom-color: rgba(185, 250, 120, 0.71);
     border-top-width: 2px;
     border-right-width: 2px;
     border-bottom-width: 2px;

+ 3 - 3
Assets/Resources/VoiceAndManu/VoiceAndMenu.uxml

@@ -2,7 +2,7 @@
     <Style src="project://database/Assets/Resources/VoiceAndManu/VoiceAndMenu.uss?fileID=7433441132597879392&amp;guid=ce67c533d6e849b47862283007c81f9a&amp;type=3#VoiceAndMenu" />
     <ui:VisualElement style="flex-grow: 1; background-size: 300% 100%;">
         <ui:VisualElement name="quit" style="flex-grow: 1; position: absolute; top: 10px; right: 10px; background-image: url(&quot;project://database/Assets/Pictures/quit.png?fileID=2800000&amp;guid=cd0b7f033ffb46346b2c4d0d11593000&amp;type=3#quit&quot;); width: 30px; height: 30px; -unity-background-image-tint-color: rgb(24, 24, 24);" />
-        <ui:VisualElement name="menuArea" style="flex-grow: 1; position: absolute; top: 360px; right: 0; width: 150px; height: 150px; visibility: visible;">
+        <ui:VisualElement name="menuArea" style="flex-grow: 1; position: absolute; top: auto; right: 0; width: 150px; height: 150px; visibility: visible; bottom: 15%;">
             <ui:VisualElement name="shop" class="subMenu" style="background-image: url(&quot;project://database/Assets/Pictures/menu%20icons/shop.png?fileID=2800000&amp;guid=6866a7131c552244286e086c0f3c0d71&amp;type=3#shop&quot;); top: 103px; left: 38px; display: flex;" />
             <ui:VisualElement name="warehouse" class="subMenu" style="background-image: url(&quot;project://database/Assets/Pictures/menu%20icons/box.png?fileID=2800000&amp;guid=e023858a18ba6044aac5f01454022545&amp;type=3#box&quot;); top: 71px; left: 29px;" />
             <ui:VisualElement name="status" class="subMenu" style="top: 111px; left: 86px; background-image: url(&quot;project://database/Assets/Pictures/menu%20icons/status.png?fileID=2800000&amp;guid=2a30515557e15584089b7100924be084&amp;type=3#status&quot;);" />
@@ -15,12 +15,12 @@
             <ui:VisualElement name="waveForm" style="flex-grow: initial; background-image: url(&quot;project://database/Assets/Pictures/waveform.png?fileID=711615006&amp;guid=743c12517ce3fef47a5c8b2f1a26f4ac&amp;type=3#waveform_0&quot;); width: 95%; height: 30px; flex-shrink: initial; -unity-background-image-tint-color: rgba(255, 255, 255, 0.74); visibility: hidden;" />
             <ui:Button name="voice" style="background-image: url(&quot;project://database/Assets/Pictures/speaker.png?fileID=-1526337199&amp;guid=e472be41a1391b94482678153c3e5f4b&amp;type=3#speaker_6&quot;); width: 100px; height: 50px; background-color: rgba(188, 188, 188, 0); background-size: 75% 75%; border-top-width: 0; border-bottom-width: 0; border-left-width: 0; border-right-width: 0;" />
         </ui:VisualElement>
-        <ui:VisualElement name="dogMenu" style="flex-grow: 1; position: absolute; top: 360px; width: auto; height: 150px; flex-direction: row; align-items: center; flex-wrap: nowrap; visibility: visible; display: flex;">
+        <ui:VisualElement name="dogMenu" style="flex-grow: 1; position: absolute; top: auto; width: auto; height: 150px; flex-direction: row; align-items: center; flex-wrap: nowrap; visibility: visible; display: flex; bottom: 15%;">
             <ui:VisualElement name="dogIcon" style="flex-grow: 1; position: relative; background-image: url(&quot;project://database/Assets/Pictures/icon2.png?fileID=585736745&amp;guid=114975168980a5d469ca1980fd07d630&amp;type=3#icon2_8&quot;); height: 40px; width: 40px; margin-left: 15px; visibility: visible;" />
             <ui:VisualElement name="dogList" style="flex-grow: 1; width: auto; position: relative; margin-left: 12px; visibility: hidden; display: flex;">
-                <ui:Label text="Label" name="dog00" class="dogNameLabel" style="width: 100%; -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;); border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; display: flex;" />
                 <ui:Label text="Label" name="dog01" class="dogNameLabel" style="width: 100%; -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;); border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; display: none;" />
                 <ui:Label text="Label" name="dog02" class="dogNameLabel" style="width: 100%; -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;); border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; display: none;" />
+                <ui:Label text="Label" name="dog02" class="dogNameLabel" style="width: 100%; -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;); border-top-width: 2px; border-right-width: 2px; border-bottom-width: 2px; border-left-width: 2px; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; display: none;" />
             </ui:VisualElement>
         </ui:VisualElement>
     </ui:VisualElement>

+ 17 - 1
Assets/Resources/Warehouse/WarehouseController.cs

@@ -18,10 +18,12 @@ public class WarehouseController : MonoBehaviour
     //弹窗元素
     private Button yesButton, noButton;
     private Label msgBody;
+    private TextField qtyField;
     private VisualElement msgRoot, msgField;
 
     // 选中的产品
     private string selectedItemId;
+    private string currentTab;
 
 
     void OnEnable()
@@ -49,12 +51,14 @@ public class WarehouseController : MonoBehaviour
         yesButton.clicked += MsgYesClick;
         noButton = msgField.Q<Button>("msgNo");
         noButton.clicked += MsgNoClick;
+        qtyField = msgField.Q<TextField>("qtyField");
 
         //初始化设定
         LanguageSetting();
 
         foodButton.transform.scale = new Vector3(1.2f, 1.2f);
         InstallItems("food");
+        qtyField.visible = false;
     }
 
     private void OnDisable()
@@ -90,6 +94,7 @@ public class WarehouseController : MonoBehaviour
     // 将items装载到菜单中,切换商品分类之后,需要重新读取和加载
     void InstallItems(string type)
     {
+        currentTab = type;
         var root = GetComponent<UIDocument>().rootVisualElement;
         itemListView.Clear();
         VisualTreeAsset itemResource = Resources.Load<VisualTreeAsset>("Shopping/Item");
@@ -139,7 +144,18 @@ public class WarehouseController : MonoBehaviour
     void ItemClick(ClickEvent clickEvent, string itemId, string description = null)
     {
         selectedItemId = itemId;
-        msgBody.text = description;
+        string targetType = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "item", currentTab, itemId, "target" });
+        targetType = currentTab + "_" + targetType;
+        string msg = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "warehouseUI", "message", targetType, EnviromentSetting.languageCode });
+        if (msg.Contains("<<dog_name>>"))
+        {
+            msg = msg.Replace("<<dog_name>>", UserProperty.dogs[GameData.focusDog].dog_name);
+        }
+        if (msg.Contains("<<item_name>>"))
+        {
+            msg = msg.Replace("<<item_name>>", description);
+        }
+        msgBody.text = msg;
         msgRoot.visible = true;
     }
 

+ 0 - 115
Assets/Scenes/Home.unity

@@ -13696,9 +13696,6 @@ GameObject:
   m_Component:
   - component: {fileID: 1707757220}
   - component: {fileID: 1707757221}
-  - component: {fileID: 1707757223}
-  - component: {fileID: 1707757225}
-  - component: {fileID: 1707757224}
   - component: {fileID: 1707757226}
   m_Layer: 0
   m_Name: VCam Dog
@@ -13762,118 +13759,6 @@ MonoBehaviour:
         m_Calls: []
   m_LegacyBlendHint: 0
   m_ComponentOwner: {fileID: 207127012}
---- !u!114 &1707757223
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1707757219}
-  m_Enabled: 0
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  m_IsGlobal: 1
-  priority: 0
-  blendDistance: 0
-  weight: 1
-  sharedProfile: {fileID: 11400000, guid: 623e2f7043efeb447b7c23ba4264efd9, type: 2}
---- !u!114 &1707757224
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1707757219}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  m_RenderShadows: 1
-  m_RequiresDepthTextureOption: 2
-  m_RequiresOpaqueTextureOption: 2
-  m_CameraType: 0
-  m_Cameras: []
-  m_RendererIndex: -1
-  m_VolumeLayerMask:
-    serializedVersion: 2
-    m_Bits: 4294967295
-  m_VolumeTrigger: {fileID: 0}
-  m_VolumeFrameworkUpdateModeOption: 2
-  m_RenderPostProcessing: 1
-  m_Antialiasing: 0
-  m_AntialiasingQuality: 2
-  m_StopNaN: 0
-  m_Dithering: 0
-  m_ClearDepth: 1
-  m_AllowXRRendering: 1
-  m_AllowHDROutput: 1
-  m_UseScreenCoordOverride: 0
-  m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
-  m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
-  m_RequiresDepthTexture: 0
-  m_RequiresColorTexture: 0
-  m_Version: 2
-  m_TaaSettings:
-    m_Quality: 3
-    m_FrameInfluence: 0.1
-    m_JitterScale: 1
-    m_MipBias: 0
-    m_VarianceClampScale: 0.9
-    m_ContrastAdaptiveSharpening: 0
---- !u!20 &1707757225
-Camera:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1707757219}
-  m_Enabled: 0
-  serializedVersion: 2
-  m_ClearFlags: 1
-  m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
-  m_projectionMatrixMode: 1
-  m_GateFitMode: 2
-  m_FOVAxisMode: 0
-  m_Iso: 200
-  m_ShutterSpeed: 0.005
-  m_Aperture: 16
-  m_FocusDistance: 10
-  m_FocalLength: 50
-  m_BladeCount: 5
-  m_Curvature: {x: 2, y: 11}
-  m_BarrelClipping: 0.25
-  m_Anamorphism: 0
-  m_SensorSize: {x: 36, y: 24}
-  m_LensShift: {x: 0, y: 0}
-  m_NormalizedViewPortRect:
-    serializedVersion: 2
-    x: 0
-    y: 0
-    width: 1
-    height: 1
-  near clip plane: 0.3
-  far clip plane: 1000
-  field of view: 60
-  orthographic: 0
-  orthographic size: 5
-  m_Depth: 0
-  m_CullingMask:
-    serializedVersion: 2
-    m_Bits: 4294967295
-  m_RenderingPath: -1
-  m_TargetTexture: {fileID: 0}
-  m_TargetDisplay: 0
-  m_TargetEye: 3
-  m_HDR: 1
-  m_AllowMSAA: 1
-  m_AllowDynamicResolution: 0
-  m_ForceIntoRT: 0
-  m_OcclusionCulling: 1
-  m_StereoConvergence: 10
-  m_StereoSeparation: 0.022
 --- !u!114 &1707757226
 MonoBehaviour:
   m_ObjectHideFlags: 0

+ 78 - 4
Assets/Scenes/Playground.unity

@@ -378,7 +378,7 @@ MonoBehaviour:
     obesity: 75
     intimate: 50
     friendly: 50
-    Obedience: 50
+    obedience: 50
     friendlyToHost: 50
     friendlyToStranger: 50
     friendlyToOtherSSDog: 50
@@ -387,6 +387,17 @@ MonoBehaviour:
     ballSkill: 50
     voiceCall: 50
     voiceCommand: 50
+    voiceCallEnable: 0
+    voiceCommandEnable: 0
+    commandSit: 0
+    commandStand: 0
+    commandBark: 0
+    commandLieDown: 0
+    commandShake: 0
+    commandTouch: 0
+    commandDeath: 0
+    commandTurnL: 0
+    commandTurnR: 0
 --- !u!1 &142544961
 GameObject:
   m_ObjectHideFlags: 0
@@ -1636,6 +1647,7 @@ GameObject:
   m_Component:
   - component: {fileID: 1313049590}
   - component: {fileID: 1313049591}
+  - component: {fileID: 1313049593}
   m_Layer: 0
   m_Name: Player CAM
   m_TagString: Untagged
@@ -1698,6 +1710,23 @@ MonoBehaviour:
         m_Calls: []
   m_LegacyBlendHint: 0
   m_ComponentOwner: {fileID: 2029850347}
+--- !u!114 &1313049593
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1313049589}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 449ef5ebbe24720439ec31d15f7b6f3d, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_FocusTracksTarget: 0
+  m_FocusTracking: 0
+  m_FocusTarget: {fileID: 0}
+  m_FocusOffset: 0
+  m_Profile: {fileID: 11400000, guid: 8bb7e6da467ab4965aa72fa967894eb2, type: 2}
 --- !u!1 &1405097793
 GameObject:
   m_ObjectHideFlags: 0
@@ -1711,7 +1740,8 @@ GameObject:
   - component: {fileID: 1405097794}
   - component: {fileID: 1405097797}
   - component: {fileID: 1405097798}
-  m_Layer: 6
+  - component: {fileID: 1405097799}
+  m_Layer: 0
   m_Name: Main Camera
   m_TagString: MainCamera
   m_Icon: {fileID: 0}
@@ -1744,7 +1774,7 @@ Camera:
   m_ShutterSpeed: 0.005
   m_Aperture: 16
   m_FocusDistance: 10
-  m_FocalLength: 50
+  m_FocalLength: 20.78461
   m_BladeCount: 5
   m_Curvature: {x: 2, y: 11}
   m_BarrelClipping: 0.25
@@ -1838,6 +1868,50 @@ MonoBehaviour:
   m_CameraActivatedEvent:
     m_PersistentCalls:
       m_Calls: []
+--- !u!114 &1405097799
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1405097793}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_RenderShadows: 1
+  m_RequiresDepthTextureOption: 2
+  m_RequiresOpaqueTextureOption: 2
+  m_CameraType: 0
+  m_Cameras: []
+  m_RendererIndex: -1
+  m_VolumeLayerMask:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_VolumeTrigger: {fileID: 0}
+  m_VolumeFrameworkUpdateModeOption: 2
+  m_RenderPostProcessing: 1
+  m_Antialiasing: 0
+  m_AntialiasingQuality: 2
+  m_StopNaN: 0
+  m_Dithering: 0
+  m_ClearDepth: 1
+  m_AllowXRRendering: 1
+  m_AllowHDROutput: 1
+  m_UseScreenCoordOverride: 0
+  m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
+  m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
+  m_RequiresDepthTexture: 0
+  m_RequiresColorTexture: 0
+  m_Version: 2
+  m_TaaSettings:
+    m_Quality: 3
+    m_FrameInfluence: 0.1
+    m_JitterScale: 1
+    m_MipBias: 0
+    m_VarianceClampScale: 0.9
+    m_ContrastAdaptiveSharpening: 0
 --- !u!1001 &1418362843
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -1852,7 +1926,7 @@ PrefabInstance:
       objectReference: {fileID: 0}
     - target: {fileID: 2417705292335416526, guid: 7b8797bfcbfe3f549ba74d2a9250e660, type: 3}
       propertyPath: m_IsActive
-      value: 0
+      value: 1
       objectReference: {fileID: 0}
     - target: {fileID: 2750614306868268629, guid: 7b8797bfcbfe3f549ba74d2a9250e660, type: 3}
       propertyPath: 'm_Materials.Array.data[0]'

+ 91 - 0
Assets/Scenes/Playground/Player CAM Profile.asset

@@ -0,0 +1,91 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &-6059406594972157605
+MonoBehaviour:
+  m_ObjectHideFlags: 3
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 0}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: c01700fd266d6914ababb731e09af2eb, type: 3}
+  m_Name: DepthOfField
+  m_EditorClassIdentifier: 
+  active: 1
+  mode:
+    m_OverrideState: 1
+    m_Value: 2
+  gaussianStart:
+    m_OverrideState: 1
+    m_Value: 0
+  gaussianEnd:
+    m_OverrideState: 1
+    m_Value: 1
+  gaussianMaxRadius:
+    m_OverrideState: 0
+    m_Value: 1.5
+  highQualitySampling:
+    m_OverrideState: 0
+    m_Value: 0
+  focusDistance:
+    m_OverrideState: 1
+    m_Value: 2.15
+  aperture:
+    m_OverrideState: 1
+    m_Value: 2
+  focalLength:
+    m_OverrideState: 1
+    m_Value: 40
+  bladeCount:
+    m_OverrideState: 0
+    m_Value: 5
+  bladeCurvature:
+    m_OverrideState: 0
+    m_Value: 1
+  bladeRotation:
+    m_OverrideState: 0
+    m_Value: 0
+--- !u!114 &11400000
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 0}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
+  m_Name: Player CAM Profile
+  m_EditorClassIdentifier: 
+  components:
+  - {fileID: -6059406594972157605}
+  - {fileID: 7387450484132847584}
+--- !u!114 &7387450484132847584
+MonoBehaviour:
+  m_ObjectHideFlags: 3
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 0}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 899c54efeace73346a0a16faa3afe726, type: 3}
+  m_Name: Vignette
+  m_EditorClassIdentifier: 
+  active: 0
+  color:
+    m_OverrideState: 1
+    m_Value: {r: 0, g: 0, b: 0, a: 1}
+  center:
+    m_OverrideState: 0
+    m_Value: {x: 0.5, y: 0.5}
+  intensity:
+    m_OverrideState: 1
+    m_Value: 0.739
+  smoothness:
+    m_OverrideState: 1
+    m_Value: 0.256
+  rounded:
+    m_OverrideState: 0
+    m_Value: 0

+ 8 - 0
Assets/Scenes/Playground/Player CAM Profile.asset.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 8bb7e6da467ab4965aa72fa967894eb2
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 11400000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
Assets/Scripts/GameControllers/GameData.cs

@@ -6,7 +6,7 @@ using System;
 public static class GameData
 {
     #region 游戏运行数据
-    public static int focusDog = 0;     // 游戏中目前玩家主要玩的狗
+    public static int focusDog = 0;     // 游戏中目前玩家主要玩的狗,便于UserProperty.dogs[focusDog]和dogsInScene[focusDog]的使用
     public static int homeCamFocusDog = 100;      // Home场景下,摄像机聚焦的狗。100表示不聚焦任何的狗
     public static bool isVoiceTrainingToday;        // 是否今天已经进行过语音训练
     // public static bool isFirstInteraction = true;        // 是否第一次互动

+ 18 - 2
Assets/Scripts/GameControllers/GameTool.cs

@@ -1,6 +1,7 @@
 using Newtonsoft.Json;
 using System;
 using System.Collections.Generic;
+using System.Net.Mail;
 using System.Text.RegularExpressions;
 using Unity.Mathematics;
 using UnityEngine;
@@ -70,11 +71,13 @@ public static class GameTool
     }
 
     // 检测新的狗名是否符合重名
-    public static bool NewDogNameAllowed(string newDogName){
+    public static bool NewDogNameAllowed(string newDogName)
+    {
         bool dogNameAllowed = true;
         foreach (var dog in UserProperty.dogs)
         {
-            if (newDogName == dog.dog_name){
+            if (newDogName == dog.dog_name)
+            {
                 dogNameAllowed = false;
             }
         }
@@ -105,4 +108,17 @@ public static class GameTool
             return false;
         }
     }
+    
+    public static bool IsValidEmail(string email)
+    {
+        try
+        {
+            var addr = new MailAddress(email);
+            return addr.Address == email;
+        }
+        catch
+        {
+            return false;
+        }
+    }
 }

+ 50 - 0
Assets/Scripts/Home/DogCollisionController.cs

@@ -0,0 +1,50 @@
+using UnityEngine;
+using UnityEngine.UIElements;
+
+/* 处理Home场景中狗的碰撞检测
+ * 该脚本用于处理狗与其他物体的碰撞检测
+ * 通过OnTriggerEnter方法来检测与其他物体的碰撞
+ * 该脚本需要挂载在狗的GameObject上
+ */
+public class DogCollisionController : MonoBehaviour
+{
+    // Start is called once before the first execution of Update after the MonoBehaviour is created
+    // void Start()
+    // {
+
+    // }
+
+    // // Update is called once per frame
+    // void Update()
+    // {
+
+    // }
+
+    void OnTriggerEnter(Collider other)
+    {
+        BoxCollider boxCollider = this.GetComponent<BoxCollider>();
+        if (boxCollider.isTrigger == true)
+        {
+            Debug.Log("collision this" + this.transform.position);
+            Debug.Log("collision other" + other.transform.position);
+            Vector3 direction = transform.position - other.transform.position;
+            Vector3 moveToLocation = this.transform.position + direction.normalized * 0.5f;
+            if (moveToLocation.x < -5f){moveToLocation.x = -5f;}
+            if (moveToLocation.x > 5f){moveToLocation.x = 5f;}
+            if (moveToLocation.z > 5f){moveToLocation.z = 5f;}
+            Debug.Log("collision moveToLocation" + moveToLocation);
+
+            GameObject thisDog = this.gameObject;
+
+            foreach (var dog in HomeController.dogsInScene)
+            {
+                if (dog.gameObject == thisDog)
+                {
+                    dog.moveToLocation = moveToLocation;
+                    dog.RandomMove();
+                    break;
+                }
+            }
+        }
+    }
+}

+ 2 - 0
Assets/Scripts/Home/DogCollisionController.cs.meta

@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 67a20833564364f018f3496211b7d78e

+ 15 - 11
Assets/Scripts/Home/DogInScene.cs

@@ -13,7 +13,7 @@ public class DogInScene //: ScriptableObject
     public DogProperty dogProperty;
     public GameObject gameObject { set; get; }
     public Animator animator;
-    private Vector3 moveToLocation;
+    public Vector3 moveToLocation;
     public float moveSpeed;     // 用来控制狗的移动速度 0 0.5跑,0.75快跑,1跳
     //public string dogState;       // 狗的状态代码分类通道,包括三大类使用道具(itemConsume),闲置(idle),训练(training),自由活动(interact)等
     public DogState dogState = DogState.IDLE;
@@ -391,15 +391,15 @@ public class DogInScene //: ScriptableObject
             else
             {
                 if (targetAngle > 0)
-            {
-                // 逆时针旋转
-                this.gameObject.transform.Rotate(0, rotationSpeed * Time.deltaTime, 0);
-            }
-            else
-            {
-                // 顺时针旋转
-                this.gameObject.transform.Rotate(0, -rotationSpeed * Time.deltaTime, 0);
-            }
+                {
+                    // 逆时针旋转
+                    this.gameObject.transform.Rotate(0, rotationSpeed * Time.deltaTime, 0);
+                }
+                else
+                {
+                    // 顺时针旋转
+                    this.gameObject.transform.Rotate(0, -rotationSpeed * Time.deltaTime, 0);
+                }
             }
         }
     }
@@ -410,8 +410,10 @@ public class DogInScene //: ScriptableObject
     // 开始整个使用道具的流程
     public void StartItemConsume(ItemGroup group)
     {
-
+        RemoveZzzParticle();       // 关闭睡觉粒子特效
         GameObject bowl = GameObject.Find("Bowl_water");        // 先指定一个碗,编译通过
+        BoxCollider boxCollider = gameObject.GetComponent<BoxCollider>();       // 喝水吃饭场景关闭isTrigger
+        boxCollider.isTrigger = false;
 
         this.itemConsumeProgress = true;        // 开启使用道具过程
         //this.dogState = "itemConsume";
@@ -570,6 +572,8 @@ public class DogInScene //: ScriptableObject
         var uiPlaceholder = GameObject.Find("UI Placeholder");
         var vamUI = uiPlaceholder.transform.Find("VoiceAndMenu").gameObject;
         vamUI.SetActive(true);
+        BoxCollider boxCollider = gameObject.GetComponent<BoxCollider>();       // 喝水吃饭场景关闭isTrigger
+        boxCollider.isTrigger = true;
         this.moveSpeed = UnityEngine.Random.Range(0.3f, 0.6f);
         RandomMove();
     }

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

@@ -418,6 +418,7 @@ public class HomeController : MonoBehaviour
         boxCollider.isTrigger = false;
         boxCollider.center = new Vector3(0, 0.25f, 0);
         boxCollider.size = new Vector3(0.12f, 0.45f, 0.54f);
+        boxCollider.isTrigger = true;
 
         // 加载Particle Question Mark
         ParticleSystem questionMarkParticle = Resources.Load<ParticleSystem>("Home/Particle_QuestionMark");
@@ -438,6 +439,8 @@ public class HomeController : MonoBehaviour
         zzzParticle.transform.localRotation = Quaternion.Euler(-90, 0, 0);
         zzzParticle.gameObject.SetActive(false);        // 默认关闭
 
+        // 添加DogCollisionController
+        DogCollisionController dogCollisionController = dog.AddComponent<DogCollisionController>();
         //yield return null;
     }
 

+ 19 - 28
Assets/Scripts/Login/ResetUIController.cs

@@ -1,6 +1,5 @@
 using Newtonsoft.Json;
 using System.Collections.Generic;
-using System.Net.Mail;
 using UnityEngine;
 using UnityEngine.UIElements;
 
@@ -17,7 +16,7 @@ public class ResetUIController : MonoBehaviour
     private Label message, errMsg;
     private TextField email, mobile, verification, password;
     private Button submit, cancel;
-    private int condition = 0; // 0: 中文初始, 1: 其他语言初始, 2: 输入验证码和新的密码
+    private SceneCondition sceneCondition = SceneCondition.ChineseInitial;
     private Dictionary<string, string> errorMessageDict = new();
     private string errorText = string.Empty;      // 错误信息汇总
     void OnEnable()
@@ -45,7 +44,7 @@ public class ResetUIController : MonoBehaviour
     // 初始化语言和显示设定
     void InitSetting()
     {
-        // 设置 shopping UI界面里面label和按键的语言显示
+        // 设置 reset UI界面里面label和按键的语言显示
         string textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "resetUI", "button", "submit", EnviromentSetting.languageCode });
         submit.text = textValue;
         textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "resetUI", "button", "cancel", EnviromentSetting.languageCode });
@@ -74,13 +73,13 @@ public class ResetUIController : MonoBehaviour
 
         if (EnviromentSetting.languageCode == "zh-cn")
         {
-            condition = 0;
+            sceneCondition = SceneCondition.ChineseInitial;
         }
         else
         {
-            condition = 1;
+            sceneCondition = SceneCondition.OtherLanguageInitial;
         }
-        ConditionSetting(condition);
+        ConditionSetting(sceneCondition.GetHashCode());
     }
 
     // 根据condition的值来显示不同的UI
@@ -138,12 +137,12 @@ public class ResetUIController : MonoBehaviour
 
     void SubmitClick()
     {
-        if (condition <= 1)
+        if (sceneCondition.GetHashCode() <= 1)
         {
             // 申请验证码阶段
             RequestVerificationCodePost();
         }
-        else if (condition ==2)
+        else if (sceneCondition.GetHashCode()  == 2)
         {
             // 输入验证码阶段和输入新密码阶段
             NewPassowrdRequest();
@@ -181,8 +180,8 @@ public class ResetUIController : MonoBehaviour
             if (data["message"] == "verification sent")
             {
                 // 发送验证码成功
-                condition = 2;
-                ConditionSetting(condition);
+                sceneCondition = SceneCondition.InputVerificationCodeAndNewPassword;
+                ConditionSetting(sceneCondition.GetHashCode());
             }
         }
         else if (data != null && data["status"] == "error")
@@ -253,7 +252,7 @@ public class ResetUIController : MonoBehaviour
 
     void FormatCheck()
     {
-        switch (condition)
+        switch (sceneCondition.GetHashCode())
         {
             case 0:
                 {
@@ -269,7 +268,7 @@ public class ResetUIController : MonoBehaviour
                 }
             case 1:
                 {
-                    if (email.value != "" && IsValidEmail(email.text))
+                    if (email.value != "" && GameTool.IsValidEmail(email.text))
                     {
                         submit.SetEnabled(true);
                     }
@@ -281,7 +280,7 @@ public class ResetUIController : MonoBehaviour
                 }
             case 2:
                 {
-                    if (verification.value != "" && password.text.Length>=8)
+                    if (verification.value != "" && password.text.Length >= 8)
                     {
                         submit.SetEnabled(true);
                     }
@@ -293,20 +292,12 @@ public class ResetUIController : MonoBehaviour
                 }
         }
     }
+}
 
-    #region 格式验证区
-    // email 格式检测
-    private bool IsValidEmail(string email)
-    {
-        try
-        {
-            var addr = new MailAddress(email);
-            return addr.Address == email;
-        }
-        catch
-        {
-            return false;
-        }
-    }
-    #endregion
+public enum SceneCondition
+{
+    // 0: 中文初始, 1: 其他语言初始, 2: 输入验证码和新的密码
+    ChineseInitial = 0,
+    OtherLanguageInitial = 1,
+    InputVerificationCodeAndNewPassword = 2,
 }