Selaa lähdekoodia

0218 更新,修复home场景下菜单逻辑问题,实现大部分菜单显示和隐藏功能。

Jees 3 kuukautta sitten
vanhempi
commit
2479360069
29 muutettua tiedostoa jossa 889 lisäystä ja 301 poistoa
  1. 28 7
      Assets/Resources/Shopping/ShoppingController.cs
  2. 17 1
      Assets/Resources/Shopping/ShoppingUI.prefab
  3. 46 30
      Assets/Resources/Status/StatusController.cs
  4. 2 0
      Assets/Resources/Status/StatusStyle.uss
  5. 1 1
      Assets/Resources/Status/StatusUI.uxml
  6. 91 18
      Assets/Resources/VoiceAndManu/MenuController.cs
  7. 2 2
      Assets/Resources/VoiceAndManu/VoiceAndMenu.prefab
  8. 6 6
      Assets/Resources/VoiceAndManu/VoiceAndMenu.uxml
  9. 2 1
      Assets/Resources/VoiceAndManu/VoiceController.cs
  10. 80 2
      Assets/Resources/Warehouse/Warehouse.prefab
  11. 27 7
      Assets/Resources/Warehouse/WarehouseController.cs
  12. 365 2
      Assets/Scenes/Home.unity
  13. 3 3
      Assets/Scenes/Login.unity
  14. 34 129
      Assets/Scenes/Playground.unity
  15. 3 3
      Assets/Scenes/Playground/playgroundUI.uxml
  16. 1 1
      Assets/Scripts/Develop Script/TestSetup.cs
  17. 2 2
      Assets/Scripts/EnviromentController.cs
  18. 0 19
      Assets/Scripts/EnviromentSetting.cs
  19. 12 10
      Assets/Scripts/Functions/WebController.cs
  20. 1 1
      Assets/Scripts/GameControllers/DogProperty.cs
  21. 7 0
      Assets/Scripts/GameControllers/GameData.cs
  22. 2 0
      Assets/Scripts/GameControllers/GameData.cs.meta
  23. 26 0
      Assets/Scripts/GameControllers/GameTool.cs
  24. 2 0
      Assets/Scripts/GameControllers/GameTool.cs.meta
  25. 54 15
      Assets/Scripts/Login/InitDogUIController.cs
  26. 48 11
      Assets/Scripts/Login/LoginController.cs
  27. 7 7
      Assets/Scripts/Login/LoginLangController.cs
  28. 13 13
      Assets/Scripts/Login/RegisterUIController.cs
  29. 7 10
      Assets/Scripts/Playground/PlayToyController.cs

+ 28 - 7
Assets/Resources/Shopping/ShoppingController.cs

@@ -23,7 +23,7 @@ public class ShoppingController : MonoBehaviour
     // 选中的产品
     private string selectedItemId;
 
-    void Start()
+    void OnEnable()
     {
         // 基层元素获取
         var root = GetComponent<UIDocument>().rootVisualElement;
@@ -39,6 +39,9 @@ public class ShoppingController : MonoBehaviour
         coinQty = coinArea.Q<Label>("coinQty");
         backButton = root.Q<Button>("back");
 
+        // 绑定事件
+        backButton.clicked += BackBtnClick;
+
         // 弹窗元素获取
         msgRoot = root.Q<VisualElement>("msgRoot");
         msgField = msgRoot.Q<VisualElement>("msgField");
@@ -53,25 +56,31 @@ public class ShoppingController : MonoBehaviour
         GetItemList("food");
         foodButton.transform.scale = new Vector3(1.2f, 1.2f);
         InstallItems("food");
+
+    }
+
+    private void OnDisable()
+    {
+        shoppingItems.Clear();       // 因为启动时候调用OnEable数据会被重复加载      
     }
 
     // Update is called once per frame
     //void Update()
     //{
-        
+
     //}
 
     //菜单语言设定
     void LanguageSetting()
     {
         // 设置 shopping UI界面里面label和按键的语言显示
-        string textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "food", EnviromentSetting.languageCode });
+        string textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "food", EnviromentSetting.languageCode });
         foodButton.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "toy", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "toy", EnviromentSetting.languageCode });
         toyButton.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "other", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "other", EnviromentSetting.languageCode });
         otherButton.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "back", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "back", EnviromentSetting.languageCode });
         backButton.text = textValue;
     }
 
@@ -81,7 +90,7 @@ public class ShoppingController : MonoBehaviour
     {
         // 按照类别获取shopping items
         shoppingItems.Clear();
-        string itemRawData = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "item", type});
+        string itemRawData = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "item", type});
         Dictionary<string, object> itemDict = JsonConvert.DeserializeObject<Dictionary<string, object>>(itemRawData);
         foreach (string _item in itemDict.Keys)
         {
@@ -159,6 +168,18 @@ public class ShoppingController : MonoBehaviour
         Debug.Log("msg yes clicked");
         msgRoot.visible = false;
     }
+
+    void BackBtnClick()
+    {
+        var uiPlaceholder = GameObject.Find("UI Placeholder");
+        if (uiPlaceholder != null)
+        {
+            var shoppingUI = uiPlaceholder.transform.Find("ShoppingUI").gameObject;
+            var vamUI = uiPlaceholder.transform.Find("VoiceAndMenu").gameObject;
+            shoppingUI.SetActive(false);
+            vamUI.SetActive(true);
+        }
+    }
 }
 
 

+ 17 - 1
Assets/Resources/Shopping/ShoppingUI.prefab

@@ -10,6 +10,7 @@ GameObject:
   m_Component:
   - component: {fileID: 4050782605140026522}
   - component: {fileID: 692315928816742920}
+  - component: {fileID: 5645513120068544489}
   m_Layer: 5
   m_Name: UIDocument
   m_TagString: Untagged
@@ -48,6 +49,21 @@ MonoBehaviour:
   m_ParentUI: {fileID: 0}
   sourceAsset: {fileID: 9197481963319205126, guid: f479f451734b5ab488f6ed24119aeb37, type: 3}
   m_SortingOrder: 0
+  m_WorldSpaceSizeMode: 1
+  m_WorldSpaceWidth: 1920
+  m_WorldSpaceHeight: 1080
+--- !u!114 &5645513120068544489
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2939730785311538782}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: e2be7075929be2643b0e1b5bbc818674, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
 --- !u!1 &4398242072932212824
 GameObject:
   m_ObjectHideFlags: 0
@@ -66,7 +82,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &3677714887249517761
 RectTransform:
   m_ObjectHideFlags: 0

+ 46 - 30
Assets/Resources/Status/StatusController.cs

@@ -4,7 +4,8 @@ using System.Collections.Generic;
 using UnityEngine;
 using UnityEngine.UIElements;
 
-// 这个controller 是用于控制 Status UI菜单的
+/* 这个controller 是用于控制 Status UI菜单的
+ */
 public class StatusController : MonoBehaviour
 {
     public Button backButton;
@@ -12,7 +13,7 @@ public class StatusController : MonoBehaviour
     DogProperty puppy;
     public VisualElement selectElement;
     // Start is called before the first frame update
-    void Start()
+    void OnEnable()
     {
         var root = GetComponent<UIDocument>().rootVisualElement;
         backButton = root.Q<Button>("back");
@@ -27,6 +28,9 @@ public class StatusController : MonoBehaviour
         statusValueLabel = root.Q<Label>("statusValue");
         selectElement = root.Q("selectElement");
 
+        // 绑定事件
+        backButton.clicked += BackBtnClick;
+
         // todo 目前只有一个狗,以后会添加这里要改
         puppy = UserProperty.dogs[0];
         StatusPageUpdate();
@@ -40,20 +44,20 @@ public class StatusController : MonoBehaviour
 
     //}
 
-    void BackPressed()
-    {
-        if (backButton != null)
-        {
-            var root = GetComponent<UIDocument>();
-            Destroy(GameObject.Find(root.GetComponentInParent<Canvas>().name));
-        }
-    }
+    //void BackPressed()
+    //{
+    //    if (backButton != null)
+    //    {
+    //        var root = GetComponent<UIDocument>();
+    //        Destroy(GameObject.Find(root.GetComponentInParent<Canvas>().name));
+    //    }
+    //}
 
     void StatusPageUpdate()
     {
-        backButton.clicked += BackPressed;
+        //backButton.clicked += BackPressed;
         nameLabel.text = puppy.name;
-        if (puppy.gender == 1) {
+        if (puppy.sex == 1) {
             genderLabel.text = "♂";
         }
         else
@@ -84,13 +88,13 @@ public class StatusController : MonoBehaviour
     void LabelLanguageSetting()
     {
         // 设置status UI界面里面label和按键的语言显示
-        string textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "button", "back", EnviromentSetting.languageCode });
+        string textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "button", "back", EnviromentSetting.languageCode });
         backButton.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "label", "host", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "label", "host", EnviromentSetting.languageCode });
         hostLabel.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "label", "days", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "label", "days", EnviromentSetting.languageCode });
         ageLabel.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "label", "status", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "label", "status", EnviromentSetting.languageCode });
         statusLabel.text = textValue;
     }
     void StatusSummary()
@@ -104,12 +108,12 @@ public class StatusController : MonoBehaviour
             if (puppy.satiety < 10)
             {
                 // 小于10,达到L2警告
-                summary += EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "satiety_2", EnviromentSetting.languageCode });
+                summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "satiety_2", EnviromentSetting.languageCode });
             }
             else
             {
                 // 不小于10,触发L1警告
-                summary += EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "satiety_1", EnviromentSetting.languageCode });
+                summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "satiety_1", EnviromentSetting.languageCode });
 
             }
             summary += "<br>";
@@ -119,12 +123,12 @@ public class StatusController : MonoBehaviour
             if (puppy.stamina < 10)
             {
                 // 小于10,达到L2警告
-                summary += EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "stamina_2", EnviromentSetting.languageCode });
+                summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "stamina_2", EnviromentSetting.languageCode });
             }
             else
             {
                 // 不小于10,触发L1警告
-                summary += EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "stamina_1", EnviromentSetting.languageCode });
+                summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "stamina_1", EnviromentSetting.languageCode });
 
             }
             summary += "<br>";
@@ -134,12 +138,12 @@ public class StatusController : MonoBehaviour
             if (puppy.thirsty < 10)
             {
                 // 小于10,达到L2警告
-                summary += EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "thirsty_2", EnviromentSetting.languageCode });
+                summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "thirsty_2", EnviromentSetting.languageCode });
             }
             else
             {
                 // 不小于10,触发L1警告
-                summary += EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "thirsty_1", EnviromentSetting.languageCode });
+                summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "thirsty_1", EnviromentSetting.languageCode });
 
             }
             summary += "<br>";
@@ -149,12 +153,12 @@ public class StatusController : MonoBehaviour
             if (puppy.healthy < 10)
             {
                 // 小于10,达到L2警告
-                summary += EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "healthy_2", EnviromentSetting.languageCode });
+                summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "healthy_2", EnviromentSetting.languageCode });
             }
             else
             {
                 // 不小于10,触发L1警告
-                summary += EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "healthy_1", EnviromentSetting.languageCode });
+                summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "healthy_1", EnviromentSetting.languageCode });
 
             }
             summary += "<br>";
@@ -164,12 +168,12 @@ public class StatusController : MonoBehaviour
             if (puppy.clean < 10)
             {
                 // 小于10,达到L2警告
-                summary += EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "clean_2", EnviromentSetting.languageCode });
+                summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "clean_2", EnviromentSetting.languageCode });
             }
             else
             {
                 // 不小于10,触发L1警告
-                summary += EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "clean_1", EnviromentSetting.languageCode });
+                summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "clean_1", EnviromentSetting.languageCode });
 
             }
             summary += "<br>";
@@ -179,12 +183,12 @@ public class StatusController : MonoBehaviour
             if (puppy.obesity >90)
             {
                 // 小于10,达到L2警告
-                summary += EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "obesity_2", EnviromentSetting.languageCode });
+                summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "obesity_2", EnviromentSetting.languageCode });
             }
             else
             {
                 // 不小于10,触发L1警告
-                summary += EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "obesity_1", EnviromentSetting.languageCode });
+                summary += GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "obesity_1", EnviromentSetting.languageCode });
 
             }
             summary += "<br>";
@@ -193,10 +197,22 @@ public class StatusController : MonoBehaviour
         // 如果没有任何异常,返回正常的状态
         if (summary.Length == 0)
         {
-            summary = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "normal", EnviromentSetting.languageCode });
+            summary = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "statusUI", "status", "normal", EnviromentSetting.languageCode });
         }
 
         statusValueLabel.text = summary;
-    }  
+    }
+
+    void BackBtnClick()
+    {
+        var uiPlaceholder = GameObject.Find("UI Placeholder");
+        if (uiPlaceholder != null)
+        {
+            var shoppingUI = uiPlaceholder.transform.Find("Status").gameObject;
+            var vamUI = uiPlaceholder.transform.Find("VoiceAndMenu").gameObject;
+            shoppingUI.SetActive(false);
+            vamUI.SetActive(true);
+        }
+    }
 }
 

+ 2 - 0
Assets/Resources/Status/StatusStyle.uss

@@ -22,6 +22,7 @@
     align-items: auto;
     -unity-text-align: middle-center;
     text-overflow: ellipsis;
+    -unity-font-definition: url("project://database/Assets/Font/MaoKenZhuYuanTi-MaokenZhuyuanTi-2.ttf?fileID=12800000&guid=50a63638b44907e46a3fa871d63b7d39&type=3#MaoKenZhuYuanTi-MaokenZhuyuanTi-2");
 }
 
 .SelectBall {
@@ -39,6 +40,7 @@
     margin-right: 3px;
     margin-bottom: 3px;
     margin-left: 3px;
+    -unity-font-definition: url("project://database/Assets/Font/MaoKenZhuYuanTi-MaokenZhuyuanTi-2.ttf?fileID=12800000&guid=50a63638b44907e46a3fa871d63b7d39&type=3#MaoKenZhuYuanTi-MaokenZhuyuanTi-2");
 }
 
 .background {

+ 1 - 1
Assets/Resources/Status/StatusUI.uxml

@@ -10,7 +10,7 @@
         <ui:Label tabindex="-1" text="&lt;YY:MM:DD&gt;" parse-escape-sequences="true" display-tooltip-when-elided="true" name="ageValue" class="Labels" style="top: 118px; left: 101px; height: 40px; width: auto; -unity-text-align: middle-left; right: 5px;" />
         <ui:Label tabindex="-1" text="状态" parse-escape-sequences="true" display-tooltip-when-elided="true" name="status" class="Labels" style="position: absolute; top: 180px; left: 30px; height: 40px; width: auto; align-self: auto; align-items: center; justify-content: center; -unity-text-align: lower-left; border-top-width: 0; border-right-width: 0; border-bottom-width: 4px; border-left-width: 0; right: 30px; padding-bottom: 0; padding-right: 0; padding-top: 0; padding-left: 0; color: rgb(255, 162, 11);" />
         <ui:Label tabindex="-1" text="&lt;To summarize status here&gt;" parse-escape-sequences="true" display-tooltip-when-elided="true" name="statusValue" class="Labels" style="top: 220px; left: 30px; height: auto; width: auto; -unity-text-align: upper-left; right: 93px; border-top-width: 0; border-right-width: 0; border-bottom-width: 0; border-left-width: 0; margin-right: 10px; margin-left: auto; margin-top: auto; margin-bottom: auto;" />
-        <ui:Button text="Back" parse-escape-sequences="true" display-tooltip-when-elided="true" name="back" style="position: relative; bottom: -90%; -unity-text-align: middle-center; white-space: nowrap; top: auto; left: auto; background-color: rgba(22, 131, 245, 0.78); border-left-color: rgba(149, 149, 149, 0); border-right-color: rgba(149, 149, 149, 0); border-top-color: rgba(149, 149, 149, 0); border-bottom-color: rgba(149, 149, 149, 0); border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; width: 100px; height: 30px; -unity-font: resource(&apos;Font/MaoKenZhuYuanTi-MaokenZhuyuanTi-2&apos;); font-size: 16px; color: rgb(255, 255, 255); -unity-font-style: bold;" />
+        <ui:Button text="Back" parse-escape-sequences="true" display-tooltip-when-elided="true" name="back" style="position: relative; bottom: -90%; -unity-text-align: middle-center; white-space: nowrap; top: auto; left: auto; background-color: rgba(22, 131, 245, 0.78); border-left-color: rgba(149, 149, 149, 0); border-right-color: rgba(149, 149, 149, 0); border-top-color: rgba(149, 149, 149, 0); border-bottom-color: rgba(149, 149, 149, 0); border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; width: 100px; height: 30px; -unity-font: resource(&apos;Font/MaoKenZhuYuanTi-MaokenZhuyuanTi-2&apos;); font-size: 16px; color: rgb(255, 255, 255); -unity-font-style: bold; -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;);" />
         <ui:VisualElement name="selectElement" style="flex-grow: 1; position: absolute; height: 20px; top: 450px; width: auto; background-color: rgba(116, 116, 116, 0.47); border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; align-items: center; align-self: auto; justify-content: flex-start; flex-direction: row;" />
     </ui:VisualElement>
 </ui:UXML>

+ 91 - 18
Assets/Resources/VoiceAndManu/MenuController.cs

@@ -1,4 +1,5 @@
- using System.Collections;
+using System;
+using System.Collections;
 using System.Collections.Generic;
 using Unity.VisualScripting;
 using UnityEngine;
@@ -13,10 +14,21 @@ public class MenuController : MonoBehaviour
     // Start is called once before the first execution of Update after the MonoBehaviour is created
     private VisualElement mainMenu;
     private List<VisualElement> subMenus = new();
-    bool isSubMenuShow = false;
- 
-    void Start()
+    //private bool isSubMenuShow = false;
+    private GameObject uiPlaceholder;       // Manu会控制其他子菜单显示和隐藏,因此所有子菜单都必须挂载在UI Placeholder下
+    private GameObject vamUI;      // vamUI = Voice and Manu UI; 
+    private GameObject shoppingUI, statusUI, warehouseUI;       // 对应点击菜单后展开的几个子菜单
+
+
+    void OnEnable()
     {
+        Debug.Log("manu controller start");
+        uiPlaceholder = GameObject.Find("UI Placeholder");
+        vamUI = uiPlaceholder.transform.Find("VoiceAndMenu").gameObject;
+        shoppingUI = uiPlaceholder.transform.Find("ShoppingUI").gameObject;
+        statusUI = uiPlaceholder.transform.Find("Status").gameObject;
+        warehouseUI = uiPlaceholder.transform.Find("Warehouse").gameObject;
+
         var root = GetComponent<UIDocument>().rootVisualElement;
         var menuArea = root.Q<VisualElement>("menuArea");
         mainMenu = menuArea.Q<VisualElement>("mainMenu");
@@ -39,15 +51,24 @@ public class MenuController : MonoBehaviour
 
         // 绑定按键点击事件
         playground.RegisterCallback<ClickEvent>(e => PlayGroundClick(e));
+        shop.RegisterCallback<ClickEvent>(e => ShopClick(e));
+        warehouse.RegisterCallback<ClickEvent>(e => WarehouseClick(e));
+        status.RegisterCallback<ClickEvent>(e => StatusClick(e));
+        cameraBtn.RegisterCallback<ClickEvent>(e => CameraClick(e));
+    }
+
+    private void OnDisable()
+    {
+        subMenus.Clear();       // 因为启动时候调用OnEable数据会被重复加载
     }
 
     // Update is called once per frame
-    //void Update()
-    //{
-        
-    //}
+    void Update()
+    {
+        CollapseMenuCheck();
+    }
 
-    Vector2 CalcPosition (Vector2 curPosition, float angle, float distance)
+    Vector2 CalcPosition(Vector2 curPosition, float angle, float distance)
     {
         float radians = angle * Mathf.Deg2Rad;
         float x = curPosition.x + distance * Mathf.Cos(radians);
@@ -59,7 +80,8 @@ public class MenuController : MonoBehaviour
     // 初始化所有按键的位置
     void InitialSubMenu()
     {
-        foreach (var subMenu in subMenus) {
+        foreach (var subMenu in subMenus)
+        {
             subMenu.style.left = mainMenu.resolvedStyle.left;
             subMenu.style.top = mainMenu.resolvedStyle.top;
             subMenu.visible = false;
@@ -69,32 +91,39 @@ public class MenuController : MonoBehaviour
     // 点击主按键后所有子按键展开并显示
     void MainMenuClick(ClickEvent evt)
     {
-        if (isSubMenuShow)
+        if (MenuData.isMenuShowed)
         {
             MenuReset();
-            isSubMenuShow = false;
             return;
         }
         // curAngle 初始角度,angleDelta 2个子菜单之间角度,distance 弹出距离,showTimer 显示时间
         float curAngle = 75f;
         float angleDelta = 40f;
         float distance = 70f;
-        float showTimer = 3.0f;
-        foreach (var subMenu in subMenus) {
+        //float showTimer = 3.0f;
+        foreach (var subMenu in subMenus)
+        {
             subMenu.visible = true;
             var newPosition = CalcPosition(mainMenu.layout.position, curAngle, distance);
             //subMenu.layout.position.Set(newPosition.x, newPosition.y);
             subMenu.style.left = newPosition.x;
             subMenu.style.top = newPosition.y;
+            if (subMenu.name == "home")
+            {
+                Debug.Log(subMenu.name + " " + newPosition.x + " " + newPosition.y);
+            }
             curAngle += angleDelta;
         }
         mainMenu.transform.scale = new Vector2(0.8f, 0.8f);
-        Invoke("MenuReset", showTimer);
-        isSubMenuShow = true;
+        //Invoke("MenuReset", showTimer);
+        //isSubMenuShow = true;
+        MenuData.isMenuShowed = true;
+        MenuData.menuShowTime = DateTime.Now;
     }
 
     // 初始化后屏幕尺寸变化时候调用。在此处应用于第一次屏幕初始化完成。
-    void OnMainMenuClickGeometryChanged(GeometryChangedEvent evt) {
+    void OnMainMenuClickGeometryChanged(GeometryChangedEvent evt)
+    {
         //VisualElement targetElement = evt.target as VisualElement;
         InitialSubMenu();
     }
@@ -103,6 +132,7 @@ public class MenuController : MonoBehaviour
     {
         //yield return new WaitForSeconds(3.0f);
         mainMenu.transform.scale = new Vector2(1.0f, 1.0f);
+        MenuData.isMenuShowed = false;
         InitialSubMenu();
     }
 
@@ -111,5 +141,48 @@ public class MenuController : MonoBehaviour
         SceneManager.LoadScene("Playground", LoadSceneMode.Single);
     }
 
-    
+    void ShopClick(ClickEvent evt)
+    {
+        vamUI.SetActive(false);
+        shoppingUI.SetActive(true);
+    }
+
+    void WarehouseClick(ClickEvent evt)
+    {
+        vamUI.SetActive(false);
+        warehouseUI.SetActive(true);
+    }
+
+    void StatusClick(ClickEvent evt)
+    {
+        vamUI.SetActive(false);
+        statusUI.SetActive(true);
+    }
+
+    void CameraClick(ClickEvent evt)
+    {
+
+    }
+
+    // 菜单打开后收回菜单
+    void CollapseMenuCheck()
+    {
+        if (MenuData.isMenuShowed)
+        {
+            // 计算两个时间点之间的差值
+            TimeSpan difference = DateTime.Now - MenuData.menuShowTime;
+
+            // 检查差值是否超过3秒
+            if (difference.TotalSeconds > 3)
+            {
+                MenuReset();
+            }
+        }
+    }
 }
+
+public static class MenuData
+{
+    public static bool isMenuShowed = false;
+    public static DateTime menuShowTime;
+}

+ 2 - 2
Assets/Resources/VoiceAndManu/VoiceAndMenu.prefab

@@ -192,7 +192,7 @@ MonoBehaviour:
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 7983087457938491336}
-  m_Enabled: 1
+  m_Enabled: 0
   m_EditorHideFlags: 0
   m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
   m_Name: 
@@ -201,4 +201,4 @@ MonoBehaviour:
   m_BlockingObjects: 0
   m_BlockingMask:
     serializedVersion: 2
-    m_Bits: 23
+    m_Bits: 4294967295

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

@@ -2,12 +2,12 @@
     <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="menuArea" style="flex-grow: 1; position: absolute; top: 360px; right: 0; width: 150px; height: 150px;">
-            <ui:VisualElement name="shop" class="subMenu" style="background-image: url(&quot;project://database/Assets/Pictures/manu.png?fileID=1092710226&amp;guid=46e529c3d84b9b34aaa338b9efa4c217&amp;type=3#shop 4&quot;); top: 103px; left: 38px; display: flex;" />
-            <ui:VisualElement name="warehouse" class="subMenu" style="background-image: url(&quot;project://database/Assets/Pictures/manu.png?fileID=1040407419&amp;guid=46e529c3d84b9b34aaa338b9efa4c217&amp;type=3#warehouse&quot;); top: 71px; left: 29px;" />
-            <ui:VisualElement name="status" class="subMenu" style="top: 111px; left: 86px; background-image: url(&quot;project://database/Assets/Pictures/manu.png?fileID=-1556414311&amp;guid=46e529c3d84b9b34aaa338b9efa4c217&amp;type=3#calc&quot;);" />
-            <ui:VisualElement name="home" class="subMenu" style="background-image: url(&quot;project://database/Assets/Pictures/manu.png?fileID=-1033102874&amp;guid=46e529c3d84b9b34aaa338b9efa4c217&amp;type=3#home&quot;); top: 5px; left: 99px;" />
-            <ui:VisualElement name="playground" class="subMenu" style="background-image: url(&quot;project://database/Assets/Pictures/manu.png?fileID=-1720006710&amp;guid=46e529c3d84b9b34aaa338b9efa4c217&amp;type=3#playground&quot;); top: 13px; left: 58px;" />
-            <ui:VisualElement name="camera" class="subMenu" style="top: 41px; left: 33px; display: flex;" />
+            <ui:VisualElement name="shop" class="subMenu" style="background-image: url(&quot;project://database/Assets/Pictures/manu.png?fileID=1092710226&amp;guid=46e529c3d84b9b34aaa338b9efa4c217&amp;type=3#shop 4&quot;); top: 103px; left: 38px; display: flex; visibility: hidden;" />
+            <ui:VisualElement name="warehouse" class="subMenu" style="background-image: url(&quot;project://database/Assets/Pictures/manu.png?fileID=1040407419&amp;guid=46e529c3d84b9b34aaa338b9efa4c217&amp;type=3#warehouse&quot;); top: 71px; left: 29px; visibility: hidden;" />
+            <ui:VisualElement name="status" class="subMenu" style="top: 111px; left: 86px; background-image: url(&quot;project://database/Assets/Pictures/manu.png?fileID=-1556414311&amp;guid=46e529c3d84b9b34aaa338b9efa4c217&amp;type=3#calc&quot;); visibility: hidden;" />
+            <ui:VisualElement name="home" class="subMenu" style="background-image: url(&quot;project://database/Assets/Pictures/manu.png?fileID=-1033102874&amp;guid=46e529c3d84b9b34aaa338b9efa4c217&amp;type=3#home&quot;); top: 5px; left: 99px; visibility: hidden;" />
+            <ui:VisualElement name="playground" class="subMenu" style="background-image: url(&quot;project://database/Assets/Pictures/manu.png?fileID=-1720006710&amp;guid=46e529c3d84b9b34aaa338b9efa4c217&amp;type=3#playground&quot;); top: 13px; left: 58px; visibility: hidden;" />
+            <ui:VisualElement name="camera" class="subMenu" style="top: 41px; left: 33px; display: flex; visibility: hidden;" />
             <ui:VisualElement name="mainMenu" class="subMenu" style="background-image: url(&quot;project://database/Assets/Packages/2D%20Casual%20UI/Sprite/GUI.png?fileID=21300072&amp;guid=1eaee135ce037439d925cee5e41ce026&amp;type=3#GUI_36&quot;); width: 26%; height: 26%; position: absolute; top: 52px; left: 85px; bottom: auto;" />
         </ui:VisualElement>
         <ui:VisualElement name="voiceArea" style="flex-grow: 1; position: absolute; bottom: 2%; flex-direction: column; justify-content: space-around; align-items: center; align-content: flex-start; width: 100%;">

+ 2 - 1
Assets/Resources/VoiceAndManu/VoiceController.cs

@@ -18,8 +18,9 @@ public class VoiceController : MonoBehaviour
     private string filePathWav, filePathZip; 
 
 
-    void Start()
+    void OnEnable()
     {
+        Debug.Log("voice controller start");
         var root = GetComponent<UIDocument>().rootVisualElement;
         var voiceArea = root.Q<VisualElement>("voiceArea");
         waveForm = voiceArea.Q<VisualElement>("waveForm");

+ 80 - 2
Assets/Resources/Warehouse/Warehouse.prefab

@@ -1,5 +1,69 @@
 %YAML 1.1
 %TAG !u! tag:unity3d.com,2011:
+--- !u!1 &1348050300974509586
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 2190482142066316667}
+  - component: {fileID: 4024425394673621061}
+  - component: {fileID: 6152834013924925173}
+  m_Layer: 5
+  m_Name: UIDocument
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &2190482142066316667
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1348050300974509586}
+  serializedVersion: 2
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 3102913922244801059}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &4024425394673621061
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1348050300974509586}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_PanelSettings: {fileID: 11400000, guid: 7ca44f0cc21b574428c09a7b6ce95659, type: 2}
+  m_ParentUI: {fileID: 0}
+  sourceAsset: {fileID: 9197481963319205126, guid: 99ec2a279b5e0e346a492dbf715b36ac, type: 3}
+  m_SortingOrder: 0
+  m_WorldSpaceSizeMode: 1
+  m_WorldSpaceWidth: 1920
+  m_WorldSpaceHeight: 1080
+--- !u!114 &6152834013924925173
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1348050300974509586}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 9a1f7b9f68520d84d8698b0beb897dea, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
 --- !u!1 &3802863874315455982
 GameObject:
   m_ObjectHideFlags: 0
@@ -12,13 +76,14 @@ GameObject:
   - component: {fileID: 4586603462066260971}
   - component: {fileID: 1715231010506462132}
   - component: {fileID: 4056314604326006357}
+  - component: {fileID: 1785906101614990902}
   m_Layer: 5
   m_Name: Warehouse
   m_TagString: Untagged
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &3102913922244801059
 RectTransform:
   m_ObjectHideFlags: 0
@@ -30,7 +95,8 @@ RectTransform:
   m_LocalPosition: {x: 0, y: 0, z: 0}
   m_LocalScale: {x: 0, y: 0, z: 0}
   m_ConstrainProportionsScale: 0
-  m_Children: []
+  m_Children:
+  - {fileID: 2190482142066316667}
   m_Father: {fileID: 0}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
@@ -101,3 +167,15 @@ MonoBehaviour:
   m_BlockingMask:
     serializedVersion: 2
     m_Bits: 4294967295
+--- !u!114 &1785906101614990902
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 3802863874315455982}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 0663909cd68af3a44a87031aedba5e8e, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 

+ 27 - 7
Assets/Resources/Warehouse/WarehouseController.cs

@@ -23,7 +23,7 @@ public class WarehouseController : MonoBehaviour
     // 选中的产品
     private string selectedItemId;
 
-    void Start()
+    void OnEable()
     {
         // 基层元素获取
         var root = GetComponent<UIDocument>().rootVisualElement;
@@ -37,6 +37,9 @@ public class WarehouseController : MonoBehaviour
         otherButton.clicked += () => TabSwitch(otherButton);
         backButton = root.Q<Button>("back");
 
+        // 绑定事件
+        backButton.clicked += BackBtnClick;
+
         // 弹窗元素获取
         msgRoot = root.Q<VisualElement>("msgRoot");
         msgField = msgRoot.Q<VisualElement>("msgField");
@@ -53,23 +56,28 @@ public class WarehouseController : MonoBehaviour
         InstallItems("food");
     }
 
+    private void OnDisable()
+    {
+        warehouseItems.Clear();       // 因为启动时候调用OnEable数据会被重复加载
+    }
+
     // Update is called once per frame
     //void Update()
     //{
-        
+
     //}
 
     //菜单语言设定
     void LanguageSetting()
     {
         // 设置 shopping UI界面里面label和按键的语言显示
-        string textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "food", EnviromentSetting.languageCode });
+        string textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "food", EnviromentSetting.languageCode });
         foodButton.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "toy", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "toy", EnviromentSetting.languageCode });
         toyButton.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "other", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "other", EnviromentSetting.languageCode });
         otherButton.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "back", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "button", "back", EnviromentSetting.languageCode });
         backButton.text = textValue;
     }
 
@@ -82,7 +90,7 @@ public class WarehouseController : MonoBehaviour
         if(UserProperty.itemStocks.TryGetValue(type, out List < ItemStock > items)){
             //List<ItemStock> items = UserProperty.itemStocks[type];
             // itemDict获取当前分类下所有item
-            string itemRawData = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "item", type });
+            string itemRawData = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "shoppingUI", "item", type });
             Dictionary<string, object> itemDict = JsonConvert.DeserializeObject<Dictionary<string, object>>(itemRawData);
             foreach (ItemStock item in items)
             {
@@ -131,6 +139,18 @@ public class WarehouseController : MonoBehaviour
         msgRoot.visible = true;
     }
 
+    void BackBtnClick()
+    {
+        var uiPlaceholder = GameObject.Find("UI Placeholder");
+        if (uiPlaceholder != null)
+        {
+            var shoppingUI = uiPlaceholder.transform.Find("Warehouse").gameObject;
+            var vamUI = uiPlaceholder.transform.Find("VoiceAndMenu").gameObject;
+            shoppingUI.SetActive(false);
+            vamUI.SetActive(true);
+        }
+    }
+
     // 数据读取
     void DataLoading()
     {

+ 365 - 2
Assets/Scenes/Home.unity

@@ -403,6 +403,108 @@ Transform:
   m_CorrespondingSourceObject: {fileID: 9013931646215088233, guid: 5dc265e918ffd904bae64f120ae40df5, type: 3}
   m_PrefabInstance: {fileID: 207424726}
   m_PrefabAsset: {fileID: 0}
+--- !u!1001 &218172244
+PrefabInstance:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_Modification:
+    serializedVersion: 3
+    m_TransformParent: {fileID: 289564902}
+    m_Modifications:
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_Pivot.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_Pivot.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_AnchorMax.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_AnchorMax.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_AnchorMin.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_AnchorMin.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_SizeDelta.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_SizeDelta.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_LocalPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_LocalPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_LocalPosition.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_LocalRotation.w
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_LocalRotation.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_LocalRotation.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_LocalRotation.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_AnchoredPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_AnchoredPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3802863874315455982, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+      propertyPath: m_Name
+      value: Warehouse
+      objectReference: {fileID: 0}
+    m_RemovedComponents: []
+    m_RemovedGameObjects: []
+    m_AddedGameObjects: []
+    m_AddedComponents: []
+  m_SourcePrefab: {fileID: 100100000, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+--- !u!224 &218172245 stripped
+RectTransform:
+  m_CorrespondingSourceObject: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
+  m_PrefabInstance: {fileID: 218172244}
+  m_PrefabAsset: {fileID: 0}
 --- !u!4 &228973348 stripped
 Transform:
   m_CorrespondingSourceObject: {fileID: 8945628110036089733, guid: 523873fc9002b974c8a0292076ec82af, type: 3}
@@ -505,6 +607,41 @@ Transform:
   m_Children: []
   m_Father: {fileID: 0}
   m_LocalEulerAnglesHint: {x: 107.618, y: 0, z: 0}
+--- !u!1 &289564901
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 289564902}
+  m_Layer: 0
+  m_Name: UI Placeholder
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &289564902
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 289564901}
+  serializedVersion: 2
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 9.725936, y: 10, z: 9.306247}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children:
+  - {fileID: 2099867579}
+  - {fileID: 1339886141}
+  - {fileID: 1754269584}
+  - {fileID: 218172245}
+  m_Father: {fileID: 0}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1001 &473038560
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -1897,6 +2034,7 @@ GameObject:
   - component: {fileID: 1189983931}
   - component: {fileID: 1189983930}
   - component: {fileID: 1189983933}
+  - component: {fileID: 1189983934}
   m_Layer: 0
   m_Name: Camera
   m_TagString: Untagged
@@ -1997,6 +2135,18 @@ MonoBehaviour:
   targetCamera: {fileID: 1189983929}
   daySkybox: {fileID: 2100000, guid: 0b846be1b116429409a7669cacf2a62e, type: 2}
   nightSkybox: {fileID: 2100000, guid: 493bfb50af5d9424da505ba945c86600, type: 2}
+--- !u!114 &1189983934
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1189983929}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 0cf1c61d68f2a7842bebe048adbcbdfd, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
 --- !u!1 &1245550629
 GameObject:
   m_ObjectHideFlags: 0
@@ -2163,6 +2313,108 @@ PrefabInstance:
     m_AddedGameObjects: []
     m_AddedComponents: []
   m_SourcePrefab: {fileID: 100100000, guid: 523873fc9002b974c8a0292076ec82af, type: 3}
+--- !u!1001 &1339886140
+PrefabInstance:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_Modification:
+    serializedVersion: 3
+    m_TransformParent: {fileID: 289564902}
+    m_Modifications:
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_Pivot.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_Pivot.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_AnchorMax.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_AnchorMax.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_AnchorMin.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_AnchorMin.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_SizeDelta.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_SizeDelta.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_LocalPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_LocalPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_LocalPosition.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_LocalRotation.w
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_LocalRotation.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_LocalRotation.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_LocalRotation.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_AnchoredPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_AnchoredPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 4398242072932212824, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+      propertyPath: m_Name
+      value: ShoppingUI
+      objectReference: {fileID: 0}
+    m_RemovedComponents: []
+    m_RemovedGameObjects: []
+    m_AddedGameObjects: []
+    m_AddedComponents: []
+  m_SourcePrefab: {fileID: 100100000, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+--- !u!224 &1339886141 stripped
+RectTransform:
+  m_CorrespondingSourceObject: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
+  m_PrefabInstance: {fileID: 1339886140}
+  m_PrefabAsset: {fileID: 0}
 --- !u!4 &1339956871 stripped
 Transform:
   m_CorrespondingSourceObject: {fileID: 4898110717027875823, guid: 920304e9d2311f74dae80fc3c069587a, type: 3}
@@ -2622,6 +2874,112 @@ Transform:
   m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 497eeb713045b2c4b84c9c4ec3b01784, type: 3}
   m_PrefabInstance: {fileID: 1706690219}
   m_PrefabAsset: {fileID: 0}
+--- !u!1001 &1754269583
+PrefabInstance:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_Modification:
+    serializedVersion: 3
+    m_TransformParent: {fileID: 289564902}
+    m_Modifications:
+    - target: {fileID: 5997909836355842307, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_Name
+      value: Status
+      objectReference: {fileID: 0}
+    - target: {fileID: 5997909836355842307, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_IsActive
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_Pivot.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_Pivot.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_AnchorMax.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_AnchorMax.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_AnchorMin.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_AnchorMin.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_SizeDelta.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_SizeDelta.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_LocalPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_LocalPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_LocalPosition.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_LocalRotation.w
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_LocalRotation.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_LocalRotation.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_LocalRotation.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_AnchoredPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_AnchoredPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.z
+      value: 0
+      objectReference: {fileID: 0}
+    m_RemovedComponents: []
+    m_RemovedGameObjects: []
+    m_AddedGameObjects: []
+    m_AddedComponents: []
+  m_SourcePrefab: {fileID: 100100000, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+--- !u!224 &1754269584 stripped
+RectTransform:
+  m_CorrespondingSourceObject: {fileID: 8435704930564478781, guid: 00b97733408f83840b44ba387e9ae31b, type: 3}
+  m_PrefabInstance: {fileID: 1754269583}
+  m_PrefabAsset: {fileID: 0}
 --- !u!1 &1886356400
 GameObject:
   m_ObjectHideFlags: 0
@@ -3020,7 +3378,7 @@ PrefabInstance:
   serializedVersion: 2
   m_Modification:
     serializedVersion: 3
-    m_TransformParent: {fileID: 0}
+    m_TransformParent: {fileID: 289564902}
     m_Modifications:
     - target: {fileID: 3819734098196001969, guid: ce6d2f68a67743945825670e3de02e19, type: 3}
       propertyPath: m_Pivot.x
@@ -3111,6 +3469,11 @@ PrefabInstance:
     m_AddedGameObjects: []
     m_AddedComponents: []
   m_SourcePrefab: {fileID: 100100000, guid: ce6d2f68a67743945825670e3de02e19, type: 3}
+--- !u!224 &2099867579 stripped
+RectTransform:
+  m_CorrespondingSourceObject: {fileID: 3819734098196001969, guid: ce6d2f68a67743945825670e3de02e19, type: 3}
+  m_PrefabInstance: {fileID: 2099867578}
+  m_PrefabAsset: {fileID: 0}
 --- !u!1 &2130545348
 GameObject:
   m_ObjectHideFlags: 0
@@ -3229,4 +3592,4 @@ SceneRoots:
   - {fileID: 921216528}
   - {fileID: 1360961875}
   - {fileID: 240199426}
-  - {fileID: 2099867578}
+  - {fileID: 289564902}

+ 3 - 3
Assets/Scenes/Login.unity

@@ -2808,7 +2808,7 @@ GameObject:
   - component: {fileID: 1349309765}
   - component: {fileID: 1349309769}
   m_Layer: 5
-  m_Name: Login Canves
+  m_Name: Login Canvas
   m_TagString: Untagged
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
@@ -2897,7 +2897,7 @@ RectTransform:
   - {fileID: 1485691657}
   - {fileID: 952681667}
   - {fileID: 497859296}
-  m_Father: {fileID: 0}
+  m_Father: {fileID: 1751824541}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
@@ -3550,6 +3550,7 @@ Transform:
   m_Children:
   - {fileID: 1940720119}
   - {fileID: 540259604}
+  - {fileID: 1349309768}
   m_Father: {fileID: 0}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
 --- !u!1 &1863178294 stripped
@@ -4304,7 +4305,6 @@ SceneRoots:
   - {fileID: 1589749813}
   - {fileID: 1389830019}
   - {fileID: 686135408}
-  - {fileID: 1349309768}
   - {fileID: 1109224427}
   - {fileID: 782739695}
   - {fileID: 317191830}

+ 34 - 129
Assets/Scenes/Playground.unity

@@ -129,7 +129,7 @@ GameObject:
   m_Component:
   - component: {fileID: 17225207}
   m_Layer: 0
-  m_Name: PlaygroundUIPlaceholder
+  m_Name: UI Placeholder
   m_TagString: Untagged
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
@@ -441,20 +441,9 @@ PrefabInstance:
       objectReference: {fileID: 0}
     m_RemovedComponents: []
     m_RemovedGameObjects: []
-    m_AddedGameObjects:
-    - targetCorrespondingSourceObject: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
-      insertIndex: -1
-      addedObject: {fileID: 981828582}
-    m_AddedComponents:
-    - targetCorrespondingSourceObject: {fileID: 3802863874315455982, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
-      insertIndex: -1
-      addedObject: {fileID: 641109532}
+    m_AddedGameObjects: []
+    m_AddedComponents: []
   m_SourcePrefab: {fileID: 100100000, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
---- !u!224 &82528521 stripped
-RectTransform:
-  m_CorrespondingSourceObject: {fileID: 3102913922244801059, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
-  m_PrefabInstance: {fileID: 82528520}
-  m_PrefabAsset: {fileID: 0}
 --- !u!1 &142544961
 GameObject:
   m_ObjectHideFlags: 0
@@ -1254,23 +1243,6 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: ac0b09e7857660247b1477e93731de29, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
---- !u!1 &641109531 stripped
-GameObject:
-  m_CorrespondingSourceObject: {fileID: 3802863874315455982, guid: a1af5d77c38f0864b935d6770025ff3d, type: 3}
-  m_PrefabInstance: {fileID: 82528520}
-  m_PrefabAsset: {fileID: 0}
---- !u!114 &641109532
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 641109531}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 0663909cd68af3a44a87031aedba5e8e, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
 --- !u!1 &760214314
 GameObject:
   m_ObjectHideFlags: 0
@@ -1368,70 +1340,6 @@ Transform:
   m_Children: []
   m_Father: {fileID: 0}
   m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
---- !u!1 &981828581
-GameObject:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  serializedVersion: 6
-  m_Component:
-  - component: {fileID: 981828582}
-  - component: {fileID: 981828583}
-  - component: {fileID: 981828584}
-  m_Layer: 5
-  m_Name: UIDocument
-  m_TagString: Untagged
-  m_Icon: {fileID: 0}
-  m_NavMeshLayer: 0
-  m_StaticEditorFlags: 0
-  m_IsActive: 1
---- !u!4 &981828582
-Transform:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 981828581}
-  serializedVersion: 2
-  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
-  m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 1, y: 1, z: 1}
-  m_ConstrainProportionsScale: 0
-  m_Children: []
-  m_Father: {fileID: 82528521}
-  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
---- !u!114 &981828583
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 981828581}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0}
-  m_Name: 
-  m_EditorClassIdentifier: 
-  m_PanelSettings: {fileID: 11400000, guid: 7ca44f0cc21b574428c09a7b6ce95659, type: 2}
-  m_ParentUI: {fileID: 0}
-  sourceAsset: {fileID: 9197481963319205126, guid: 99ec2a279b5e0e346a492dbf715b36ac, type: 3}
-  m_SortingOrder: 0
-  m_WorldSpaceSizeMode: 1
-  m_WorldSpaceWidth: 1920
-  m_WorldSpaceHeight: 1080
---- !u!114 &981828584
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 981828581}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: 9a1f7b9f68520d84d8698b0beb897dea, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
 --- !u!1 &1014406022
 GameObject:
   m_ObjectHideFlags: 0
@@ -1652,10 +1560,32 @@ BoxCollider:
   m_LayerOverridePriority: 0
   m_IsTrigger: 0
   m_ProvidesContacts: 0
-  m_Enabled: 1
+  m_Enabled: 0
   serializedVersion: 3
   m_Size: {x: 31.975658, y: 0.05, z: 29.94}
   m_Center: {x: 0.0000038146973, y: 0, z: -0.15816975}
+--- !u!64 &1045875710
+MeshCollider:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1045875704}
+  m_Material: {fileID: 0}
+  m_IncludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_ExcludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_LayerOverridePriority: 0
+  m_IsTrigger: 0
+  m_ProvidesContacts: 0
+  m_Enabled: 1
+  serializedVersion: 5
+  m_Convex: 0
+  m_CookingOptions: 30
+  m_Mesh: {fileID: -7437940611004454655, guid: f26825f37797b4f1d82f00cd136b61ce, type: 3}
 --- !u!1001 &1059432382
 PrefabInstance:
   m_ObjectHideFlags: 0
@@ -1664,10 +1594,6 @@ PrefabInstance:
     serializedVersion: 3
     m_TransformParent: {fileID: 0}
     m_Modifications:
-    - target: {fileID: 692315928816742920, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
-      propertyPath: sourceAsset
-      value: 
-      objectReference: {fileID: 9197481963319205126, guid: f479f451734b5ab488f6ed24119aeb37, type: 3}
     - target: {fileID: 3677714887249517761, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
       propertyPath: m_Pivot.x
       value: 0
@@ -1759,10 +1685,7 @@ PrefabInstance:
     m_RemovedComponents: []
     m_RemovedGameObjects: []
     m_AddedGameObjects: []
-    m_AddedComponents:
-    - targetCorrespondingSourceObject: {fileID: 2939730785311538782, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
-      insertIndex: -1
-      addedObject: {fileID: 1199603698}
+    m_AddedComponents: []
   m_SourcePrefab: {fileID: 100100000, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
 --- !u!1 &1159468012
 GameObject:
@@ -1935,23 +1858,6 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 250517a90c8a4944eb9905ca76f71465, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
---- !u!1 &1199603695 stripped
-GameObject:
-  m_CorrespondingSourceObject: {fileID: 2939730785311538782, guid: 97ce34e9499d305478cb0fecb9290cab, type: 3}
-  m_PrefabInstance: {fileID: 1059432382}
-  m_PrefabAsset: {fileID: 0}
---- !u!114 &1199603698
-MonoBehaviour:
-  m_ObjectHideFlags: 0
-  m_CorrespondingSourceObject: {fileID: 0}
-  m_PrefabInstance: {fileID: 0}
-  m_PrefabAsset: {fileID: 0}
-  m_GameObject: {fileID: 1199603695}
-  m_Enabled: 1
-  m_EditorHideFlags: 0
-  m_Script: {fileID: 11500000, guid: e2be7075929be2643b0e1b5bbc818674, type: 3}
-  m_Name: 
-  m_EditorClassIdentifier: 
 --- !u!1 &1313049589
 GameObject:
   m_ObjectHideFlags: 0
@@ -2398,6 +2304,9 @@ PrefabInstance:
     - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: f26825f37797b4f1d82f00cd136b61ce, type: 3}
       insertIndex: -1
       addedObject: {fileID: 1045875709}
+    - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: f26825f37797b4f1d82f00cd136b61ce, type: 3}
+      insertIndex: -1
+      addedObject: {fileID: 1045875710}
   m_SourcePrefab: {fileID: 100100000, guid: f26825f37797b4f1d82f00cd136b61ce, type: 3}
 --- !u!1 &1858575942
 GameObject:
@@ -2835,10 +2744,6 @@ PrefabInstance:
     serializedVersion: 3
     m_TransformParent: {fileID: 0}
     m_Modifications:
-    - target: {fileID: 1349988398253066161, guid: ce6d2f68a67743945825670e3de02e19, type: 3}
-      propertyPath: sourceAsset
-      value: 
-      objectReference: {fileID: 9197481963319205126, guid: 1093b48dd2b012948b6976d49baef305, type: 3}
     - target: {fileID: 3819734098196001969, guid: ce6d2f68a67743945825670e3de02e19, type: 3}
       propertyPath: m_Pivot.x
       value: 0
@@ -2923,6 +2828,10 @@ PrefabInstance:
       propertyPath: m_Name
       value: VoiceAndManu
       objectReference: {fileID: 0}
+    - target: {fileID: 7983087457938491336, guid: ce6d2f68a67743945825670e3de02e19, type: 3}
+      propertyPath: m_IsActive
+      value: 0
+      objectReference: {fileID: 0}
     - target: {fileID: 8362141720302802052, guid: ce6d2f68a67743945825670e3de02e19, type: 3}
       propertyPath: m_Enabled
       value: 0
@@ -2931,10 +2840,6 @@ PrefabInstance:
       propertyPath: m_BlockingMask.m_Bits
       value: 4294967295
       objectReference: {fileID: 0}
-    - target: {fileID: 8362141720302802052, guid: ce6d2f68a67743945825670e3de02e19, type: 3}
-      propertyPath: m_IgnoreReversedGraphics
-      value: 1
-      objectReference: {fileID: 0}
     m_RemovedComponents: []
     m_RemovedGameObjects: []
     m_AddedGameObjects: []

+ 3 - 3
Assets/Scenes/Playground/playgroundUI.uxml

@@ -1,10 +1,10 @@
 <ui:UXML xmlns:ui="UnityEngine.UIElements" xmlns:uie="UnityEditor.UIElements" editor-extension-mode="True">
     <Style src="project://database/Assets/UI%20Toolkit/Style/rootStyle.uss?fileID=7433441132597879392&amp;guid=b30eb17a0ca8bf64087af4e59d565fdd&amp;type=3#rootStyle" />
     <ui:VisualElement name="VisualElement" style="-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: 28px; -unity-text-align: upper-center; color: rgb(255, 107, 45); -unity-text-outline-color: rgba(105, 202, 255, 0.79); -unity-text-outline-width: 1px;">
-        <ui:Label text="打发打发十分舒服撒发生" name="gameResult" double-click-selects-word="false" style="width: auto; margin-left: 20px; margin-right: 20px; margin-top: 40px; white-space: normal;" />
+        <ui:Label text="打发打发十分舒服撒发生" name="gameResult" double-click-selects-word="false" style="width: auto; margin-left: 20px; margin-right: 20px; margin-top: 40px; white-space: normal; color: rgb(24, 24, 24); -unity-text-outline-width: 0.2px;" />
         <ui:VisualElement name="btnArea" style="flex-direction: row; justify-content: space-around;">
-            <ui:Button text="确认拉" name="confirm" class="button" style="height: 30px; -unity-text-outline-width: 0; font-size: 16px; width: 100px; color: rgb(255, 107, 45); background-color: rgba(22, 131, 245, 0.78); border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; border-top-width: 0; border-right-width: 0; border-bottom-width: 0; border-left-width: 0;" />
-            <ui:Button text="Play Again" name="playAgain" class="button" style="height: 30px; font-size: 16px; -unity-text-outline-width: 0; width: 100px; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; border-top-width: 0; border-bottom-width: 0; border-right-width: 0; border-left-width: 0; background-color: rgba(136, 245, 22, 0.78);" />
+            <ui:Button text="确认拉" name="confirm" class="button" style="height: 30px; -unity-text-outline-width: 0; font-size: 16px; width: 100px; color: rgb(255, 255, 255); background-color: rgba(236, 67, 37, 0.78); border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; border-top-width: 0; border-right-width: 0; border-bottom-width: 0; border-left-width: 0;" />
+            <ui:Button text="Play Again" name="playAgain" class="button" style="height: 30px; font-size: 16px; -unity-text-outline-width: 0; width: 100px; border-top-left-radius: 10px; border-top-right-radius: 10px; border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; border-top-width: 0; border-bottom-width: 0; border-right-width: 0; border-left-width: 0; background-color: rgba(136, 245, 22, 0.78); color: rgb(255, 255, 255);" />
         </ui:VisualElement>
     </ui:VisualElement>
 </ui:UXML>

+ 1 - 1
Assets/Scripts/Develop Script/TestSetup.cs

@@ -8,7 +8,7 @@ public class TestSetup : MonoBehaviour
     {
         // 初始化狗数据用于测试
         DogProperty puppy = new DogProperty();
-        puppy.runSpeed = 1000;
+        puppy.runSpeed = 100;
         puppy.skin = "yellow";
         UserProperty.dogs.Add(puppy);
 

+ 2 - 2
Assets/Scripts/EnviromentController.cs

@@ -20,8 +20,8 @@ public class EnviromentController : MonoBehaviour
     void Start()
     {
         // todo 开发代码,加载狗的信息,以后要移到ProgressBar页面
-        DogProperty puppy_1 = new();
-        UserProperty.dogs.Add(puppy_1);
+        //DogProperty puppy_1 = new();
+        //UserProperty.dogs.Add(puppy_1);
     }
 
     public static void InitialGameEnviroment()

+ 0 - 19
Assets/Scripts/EnviromentSetting.cs

@@ -41,25 +41,6 @@ public static class EnviromentSetting
     public static DogBreed[] dogBreeds;
     
 
-    //用于获取多层级Dictionary中的value
-    public static string GetValueAtPath(Dictionary<string, object> root, string[] path)
-    {
-        Dictionary<string, object> current = root;
-        int count = 0;
-        foreach (string key in path)
-        {
-            string rawValue = current[key].ToString();
-            rawValue = Regex.Replace(rawValue, @"[\r\n]", "");
-            if (count == path.Length-1)
-            {
-                return rawValue;
-            }
-            Dictionary<string, object> value = JsonConvert.DeserializeObject<Dictionary<string, object>>(rawValue);
-            current = value;
-            count++;
-        }
-        return null;
-    }
 }
 
 

+ 12 - 10
Assets/Scripts/Functions/WebController.cs

@@ -6,6 +6,8 @@ using UnityEngine.Networking;
 
 
 /* 本文件二次封装Web request
+ * 不需要客户端确认是否需要提交accss_token,access_token白名单在EnviromentSetting里面
+ * PostRequest 需要提交url, wwwForm, 上传附件path, 回调函数
  */
 
 public class WebController : MonoBehaviour {
@@ -22,11 +24,9 @@ public class WebController : MonoBehaviour {
 
     //}
 
-    public static IEnumerator PostRequest(string url,  Dictionary<string, string> postData=null, string filePath = null, System.Action<string> callback=null)
+    public static IEnumerator PostRequest(string url,  WWWForm wwwForm, string filePath = null, System.Action<string> callback=null)
     {
      
-        // 创建 WWWForm 对象
-        WWWForm form = new WWWForm();
         // 添加access token
         bool accessTokenReq = true;
         foreach (string whiteUrl in EnviromentSetting.accessTokenWhiteList)
@@ -36,24 +36,26 @@ public class WebController : MonoBehaviour {
                 accessTokenReq = false;
             }
         }
-        if (accessTokenReq) { form.AddField("access_token", EnviromentSetting.accessToken); }
+
+        // 检测是否需要添加access_token
+        if (accessTokenReq) { wwwForm.AddField("access_token", EnviromentSetting.accessToken); }
         
 
         // 添加表单字段
-        foreach (var item in postData)
-        {
-            form.AddField(item.Key, item.Value);
-        }
+        //foreach (var item in postData)
+        //{
+        //    form.AddField(item.Key, item.Value);
+        //}
 
         // 添加文件
         if (filePath != null)
         {
             byte[] fileData = System.IO.File.ReadAllBytes(filePath);
-            form.AddBinaryData(Path.GetFileName(filePath), fileData);
+            wwwForm.AddBinaryData(Path.GetFileName(filePath), fileData);
         }
         // 创建 UnityWebRequest 对象
         url = EnviromentSetting.serverIp + url;
-        using (UnityWebRequest request = UnityWebRequest.Post(url, form))
+        using (UnityWebRequest request = UnityWebRequest.Post(url, wwwForm))
         {
             // 发送请求并等待响应
             yield return request.SendWebRequest();

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

@@ -15,7 +15,7 @@ public class DogProperty
     // Start is called before the first frame update
     public string id = "121212121";
     public string name = "小泥鳅";
-    public int gender = 1;
+    public int sex = 1;
     public string breed = "shibaInu";       // 狗的默认模型
     public string skin = "black";     // 狗的默认贴图
     public DateTime brithday = new(2023, 1, 1, 12, 0, 0);

+ 7 - 0
Assets/Scripts/GameControllers/GameData.cs

@@ -0,0 +1,7 @@
+/* 存放游戏运行中一些保存的数据
+ */
+
+public static class GameData
+{
+    public static string subScene;      // 用于指定子场景用
+}

+ 2 - 0
Assets/Scripts/GameControllers/GameData.cs.meta

@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 63a940aac426d634ca8610458fd17e04

+ 26 - 0
Assets/Scripts/GameControllers/GameTool.cs

@@ -0,0 +1,26 @@
+using Newtonsoft.Json;
+using System.Collections.Generic;
+using System.Text.RegularExpressions;
+
+public static class GameTool
+{
+    //ÓÃÓÚ»ñÈ¡¶à²ã¼¶DictionaryÖеÄvalue
+    public static string GetValueAtPath(Dictionary<string, object> root, string[] path)
+    {
+        Dictionary<string, object> current = root;
+        int count = 0;
+        foreach (string key in path)
+        {
+            string rawValue = current[key].ToString();
+            rawValue = Regex.Replace(rawValue, @"[\r\n]", "");
+            if (count == path.Length - 1)
+            {
+                return rawValue;
+            }
+            Dictionary<string, object> value = JsonConvert.DeserializeObject<Dictionary<string, object>>(rawValue);
+            current = value;
+            count++;
+        }
+        return null;
+    }
+}

+ 2 - 0
Assets/Scripts/GameControllers/GameTool.cs.meta

@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: e282bd4207c324647a38641c9437632b

+ 54 - 15
Assets/Scripts/Login/InitDogUIController.cs

@@ -1,7 +1,8 @@
-using UnityEngine;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
 using UnityEngine.Rendering.PostProcessing;
 using UnityEngine.UIElements;
-using static UnityEngine.AudioSettings;
 
 /* 本controller用来控制创建宠物UI和相关通讯的代码
  * 设置注册语言
@@ -15,10 +16,10 @@ public class InitDogUIController : MonoBehaviour
     private Label leftArrow, rightArrow;
     private DropdownField breedDropdownField, sexDropdownField;
     private Button confirmBtn, cancelBtn;
-    private DogBreed dogBreed;
+    private DogBreed dogBreed;      // 狗品种的具体设定数据
     private string femaleText, maleText;
     private int dogSkinIndex = 0;      // 显示狗的皮肤颜色
-    DogProperty dogProperty = new();
+    private DogProperty dogProperty;        // 用于暂存生成狗的属性配置
 
     public string displayDogName = "createdDog";
     // Start is called once before the first execution of Update after the MonoBehaviour is created
@@ -45,7 +46,7 @@ public class InitDogUIController : MonoBehaviour
     // Update is called once per frame
     void Update()
     {
-        
+        fieldsContentCheck();
     }
 
     // 绑定breed下拉框更新,读取相对应的狗的数据
@@ -122,6 +123,34 @@ public class InitDogUIController : MonoBehaviour
             }
         }
     }
+    // 绑定点击按键
+    void ConfirmClick()
+    {
+        dogProperty.name = dogNameTextField.text;
+        ConfirmClickPost();
+    }
+
+    // ConfirmClick点击后第一步POST事件
+    void ConfirmClickPost()
+    {
+        string url = "/api/login/token/";
+        Dictionary<string, string> formData = new Dictionary<string, string>();
+        WWWForm wwwForm = new WWWForm();
+        wwwForm.AddField("access_token", EnviromentSetting.accessToken);
+        wwwForm.AddField("user_id", UserProperty.userId);
+        wwwForm.AddField("dog_name", dogProperty.name);
+        wwwForm.AddField("dog_sex", dogProperty.sex);
+        wwwForm.AddField("dog_breed", dogProperty.breed);
+        wwwForm.AddField("dog_skin", dogProperty.skin);
+
+        StartCoroutine(WebController.PostRequest(url, wwwForm, callback: ConfirmClickCallback));
+    }
+
+    // ConfirmClick点击后POST数据返回后Callback
+    void ConfirmClickCallback(string json)
+    {
+
+    }
 
     // 绑定取消按键
     void CancelClick()
@@ -134,30 +163,30 @@ public class InitDogUIController : MonoBehaviour
     void InitSetting()
     {
         // 设置 shopping UI界面里面label和按键的语言显示
-        string textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "button", "confirm", EnviromentSetting.languageCode });
+        string textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "button", "confirm", EnviromentSetting.languageCode });
         confirmBtn.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "button", "cancel", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "button", "cancel", EnviromentSetting.languageCode });
         cancelBtn.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "label", "name", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "label", "name", EnviromentSetting.languageCode });
         dogNameTextField.label = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "label", "breed", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "label", "breed", EnviromentSetting.languageCode });
         breedDropdownField.label = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "label", "sex", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "label", "sex", EnviromentSetting.languageCode });
         sexDropdownField.label = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "label", "female", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "label", "female", EnviromentSetting.languageCode });
         femaleText = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "label", "male", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "InitDogUI", "label", "male", EnviromentSetting.languageCode });
         maleText = textValue;
 
         // 判断用户名下有几条狗,如果超过1条就可以显示取消
-        if (UserProperty.dogs.Count > 0)
+        if (UserProperty.dogs.Count >= 1)
         {
-            cancelBtn.style.display = DisplayStyle.None;
+            cancelBtn.style.display = DisplayStyle.Flex;
         }
         else
         {
             //cancel.visible = false;
-            cancelBtn.style.display = DisplayStyle.Flex;
+            cancelBtn.style.display = DisplayStyle.None;
         }
 
         foreach(var item in EnviromentSetting.dogBreeds)
@@ -171,4 +200,14 @@ public class InitDogUIController : MonoBehaviour
         //breed.index = 0;
         //sex.index = 0;
     }
+
+    // 检测狗名字,品种,性别都有内容
+    void fieldsContentCheck()
+    {
+        if (!string.IsNullOrWhiteSpace(dogNameTextField.text) && !string.IsNullOrWhiteSpace(breedDropdownField.text) && !string.IsNullOrWhiteSpace(sexDropdownField.text))
+        {
+            confirmBtn.SetEnabled(true);
+        }
+        else {  confirmBtn.SetEnabled(false); }
+    }
 }

+ 48 - 11
Assets/Scripts/Login/LoginController.cs

@@ -7,6 +7,7 @@ using Unity.VisualScripting;
 using Newtonsoft.Json;
 using UnityEngine.SceneManagement;
 using UnityEditor;
+using Cinemachine;
 
 /* 使用login token进行登录和数据读取保存
  * TestDataInjection 是测试用的假数据注入
@@ -15,10 +16,23 @@ using UnityEditor;
 public class LoginController : MonoBehaviour
 {
     // Start is called once before the first execution of Update after the MonoBehaviour is created
+    private GameObject canvasPlaceholder, regCanvas, initDogCanvas, loginCanvas;
+
     void Start()
     {
         //启动自动采用Login Token 登录。其他登录方式为手动登录。
-        //StartCoroutine(LoginTokenRequest());
+        StartCoroutine(LoginTokenPost());
+        canvasPlaceholder = GameObject.Find("Canvas Placeholder");
+        regCanvas = canvasPlaceholder.transform.Find("Register Canvas").gameObject;
+        initDogCanvas = canvasPlaceholder.transform.Find("Init Dog Canvas").gameObject;
+        loginCanvas = canvasPlaceholder.transform.Find("Login Canvas").gameObject;
+
+        // 判断是否要切换到注册狗的子场景
+        if ( GameData.subScene == "Login_InitDog")
+        {
+            SwitchToInitDogScene();
+            GameData.subScene = null;
+        }
     }
 
     // Update is called once per frame
@@ -30,7 +44,7 @@ public class LoginController : MonoBehaviour
 
 
     // LoginToken登录方法
-    IEnumerator LoginTokenEvent()
+    IEnumerator LoginTokenPost()
     {
         //yield return null;      // 跳过第一帧(可以考虑去掉,数据加载已经移到awake()了。
         string UUID = SystemInfo.deviceUniqueIdentifier; // 这里需要考虑这段代码执行在Enviroment Controller之前
@@ -54,11 +68,11 @@ public class LoginController : MonoBehaviour
 
         // 提交POST
         string url = "/api/login/token/";
-        Dictionary<string, string> formData = new();
-        formData.Add("login_token", LoginToken);
-        formData.Add("UUID", UUID);
+        WWWForm form = new();
+        form.AddField("login_token", LoginToken);
+        form.AddField("UUID", UUID);
 
-        StartCoroutine(WebController.PostRequest(url, formData, callback:LoginTokenCallback));
+        StartCoroutine(WebController.PostRequest(url, form, callback:LoginTokenCallback));
     }
 
     // Post之后callback的函数
@@ -71,10 +85,20 @@ public class LoginController : MonoBehaviour
             EnviromentSetting.accessToken = data["access_token"];
             EnviromentSetting.accessTokenReceivedTime = DateTime.Now;
             UserProperty.userId = data["user_id"];
+            // todo 用user id 获取用户数据并保存
         }
         if (UserProperty.userId != null && EnviromentSetting.accessToken != null)
-        {
-            SceneManager.LoadScene("Home");
+        { 
+            // 判断用户狗的数量,如果为0就跳转用户创建狗。
+            if (UserProperty.dogs.Count < 1)
+            {
+                SwitchToInitDogScene();
+            }
+             else
+            {
+                SceneManager.LoadScene("Home");
+                
+            }
         }
     }
 
@@ -83,8 +107,9 @@ public class LoginController : MonoBehaviour
     {
         string url = "/api/game/quick_start/";
         Dictionary<string, string> formData = new();
-        formData.Add("UUID", EnviromentSetting.UUID);
-        StartCoroutine(WebController.PostRequest(url, formData, callback: QuickStartCallback));
+        WWWForm form = new();
+        form.AddField("UUID", EnviromentSetting.UUID);
+        StartCoroutine(WebController.PostRequest(url, form, callback: QuickStartCallback));
     }
 
     void QuickStartCallback(string json)
@@ -94,7 +119,19 @@ public class LoginController : MonoBehaviour
         {
             PlayerPrefs.SetString("LoginToken", data["login_token"]);
             UserProperty.userId = data["user_id"];
-            StartCoroutine(LoginTokenEvent());
+            StartCoroutine(LoginTokenPost());
         }
     }
+
+    // 切换到生成狗的子场景
+    void SwitchToInitDogScene()
+    {
+        initDogCanvas.SetActive(true);
+        loginCanvas.SetActive(false);
+        regCanvas.SetActive(false);
+        var loginCam = GameObject.Find("V Cam Login").GetComponent<CinemachineVirtualCamera>();
+        var initDogCam = GameObject.Find("V Cam Init Dog").GetComponent<CinemachineVirtualCamera>();
+        loginCam.Priority = 0;
+        initDogCam.Priority = 10;
+    }
 }

+ 7 - 7
Assets/Scripts/Login/LoginLangController.cs

@@ -23,19 +23,19 @@ public class LoginLangController : MonoBehaviour
     void LoginCanvasLangSetting()
     {
         //读取Login Canvas语言设定
-        string textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "button", "login", EnviromentSetting.languageCode });
+        string textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "button", "login", EnviromentSetting.languageCode });
         GameObject.Find("Login Button").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "button", "forget_password", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "button", "forget_password", EnviromentSetting.languageCode });
         GameObject.Find("Forget Password Button").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "button", "quick_start", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "button", "quick_start", EnviromentSetting.languageCode });
         GameObject.Find("Quick Start Button").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "label", "user_name", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "label", "user_name", EnviromentSetting.languageCode });
         GameObject.Find("User Name").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "label", "password", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "label", "password", EnviromentSetting.languageCode });
         GameObject.Find("Password").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "place_holder", "user_name", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "place_holder", "user_name", EnviromentSetting.languageCode });
         GameObject.Find("UserName Placeholder").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "place_holder", "password", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "canvas", "login", "place_holder", "password", EnviromentSetting.languageCode });
         GameObject.Find("Password Placeholder").GetComponentInChildren<TextMeshProUGUI>().text = textValue;
     }
 }

+ 13 - 13
Assets/Scripts/Login/RegisterUIController.cs

@@ -72,31 +72,31 @@ public class RegisterUIController : MonoBehaviour
     void InitSetting()
     {
         // 设置 shopping UI界面里面label和按键的语言显示
-        string textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "button", "confirm", EnviromentSetting.languageCode });
+        string textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "button", "confirm", EnviromentSetting.languageCode });
         confirm.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "button", "cancel", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "button", "cancel", EnviromentSetting.languageCode });
         cancel.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "label", "name", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "label", "name", EnviromentSetting.languageCode });
         userName.label = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "label", "password", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "label", "password", EnviromentSetting.languageCode });
         password.label = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "label", "mobile", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "label", "mobile", EnviromentSetting.languageCode });
         mobile.label = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "label", "email", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "label", "email", EnviromentSetting.languageCode });
         email.label = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "duplicated_user_name", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "duplicated_user_name", EnviromentSetting.languageCode });
         errorMessageDict.Add("duplicated_user_name", textValue);
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "user_name_is_empty", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "user_name_is_empty", EnviromentSetting.languageCode });
         errorMessageDict.Add("user_name_is_empty", textValue);
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "password_too_short", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "password_too_short", EnviromentSetting.languageCode });
         errorMessageDict.Add("password_too_short", textValue);
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "mobile_is_empty", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "mobile_is_empty", EnviromentSetting.languageCode });
         errorMessageDict.Add("mobile_is_empty", textValue);
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "email_is_empty", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "email_is_empty", EnviromentSetting.languageCode });
         errorMessageDict.Add("email_is_empty", textValue);
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "email_format_wrong", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "email_format_wrong", EnviromentSetting.languageCode });
         errorMessageDict.Add("email_format_wrong", textValue);
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "duplicated_email", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "registerUI", "error_msg", "duplicated_email", EnviromentSetting.languageCode });
         errorMessageDict.Add("duplicated_email", textValue);
 
         if (EnviromentSetting.languageCode == "zh-cn")

+ 7 - 10
Assets/Scripts/Playground/PlayToyController.cs

@@ -28,14 +28,11 @@ public class PlayToyController : MonoBehaviour
     // Start is called once before the first execution of Update after the MonoBehaviour is created
     void Start()
     {
-
         PlayData.Reset();
 
         CamPlayer = GameObject.Find("Player CAM").GetComponent<CinemachineVirtualCamera>();
         CamDog = GameObject.Find("Dog CAM").GetComponent<CinemachineVirtualCamera>();
-        
-        
-        
+
     }
 
     // FixedUpdate is called once per frame
@@ -181,9 +178,9 @@ public class PlayToyController : MonoBehaviour
         var confirmBtn = btnArea.Q<Button>("confirm");
         var playagainBtn = btnArea.Q<Button>("playAgain");
 
-        string textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "playgroundUI", "button", "confirm", EnviromentSetting.languageCode });
+        string textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "playgroundUI", "button", "confirm", EnviromentSetting.languageCode });
         confirmBtn.text = textValue;
-        textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "playgroundUI", "button", "play_again", EnviromentSetting.languageCode });
+        textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "playgroundUI", "button", "play_again", EnviromentSetting.languageCode });
         playagainBtn.text = textValue;
 
         playagainBtn.clicked += ()=> GameReset();
@@ -195,7 +192,7 @@ public class PlayToyController : MonoBehaviour
     {
         if (PlayData.isResultShowed == false)
         {
-            var playgroundUI = GameObject.Find("PlaygroundUIPlaceholder").transform.Find("PlaygroundUI").gameObject;
+            var playgroundUI = GameObject.Find("UI Placeholder").transform.Find("PlaygroundUI").gameObject;
             playgroundUI.SetActive(true);
             UI_Initial();
             var root = GameObject.Find("PlaygroundUIDocument").GetComponent<UIDocument>().rootVisualElement;
@@ -203,18 +200,18 @@ public class PlayToyController : MonoBehaviour
             string textValue;
             if (PlayData.gameStatus == PlayData.GameStatus.finishSuccess)
             {
-                textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "playgroundUI", "label", "game_result", "finishSuccess", EnviromentSetting.languageCode });
+                textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "playgroundUI", "label", "game_result", "finishSuccess", EnviromentSetting.languageCode });
                 textValue = textValue.Replace("<<distance>>", Math.Round(PlayData.throwDistance(), 2).ToString());   // 保留小数点后2位
                 gameResult.text = textValue;
             }
             else if (PlayData.gameStatus == PlayData.GameStatus.finishFail)
             {
-                textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "playgroundUI", "label", "game_result", "finishFail", EnviromentSetting.languageCode });
+                textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "playgroundUI", "label", "game_result", "finishFail", EnviromentSetting.languageCode });
                 gameResult.text = textValue;
             }
             else if (PlayData.gameStatus == PlayData.GameStatus.finishOutOfBound)
             {
-                textValue = EnviromentSetting.GetValueAtPath(EnviromentSetting.languageData, new string[] { "playgroundUI", "label", "game_result", "finishOutOfBound", EnviromentSetting.languageCode });
+                textValue = GameTool.GetValueAtPath(EnviromentSetting.languageData, new string[] { "playgroundUI", "label", "game_result", "finishOutOfBound", EnviromentSetting.languageCode });
                 gameResult.text = textValue;
             }
         }