Browse Source

添加保存失败,增加弹窗

蓝色星空 1 year ago
parent
commit
136436732a

+ 9 - 0
Assets/Scripts/BaseManager/DataManager.cs

@@ -164,6 +164,15 @@ public class DataManager : SingletonMono<DataManager>
         JObject jObject = JObject.Parse(message);
         string str = jObject["message"].ToString();
 
+        if(str!="更新成功")
+        {
+            InstantiateCommand Command =new InstantiateCommand(
+                InstantiateSystem.Instance.BlueObject.WarningPopUp,
+                InstantiateSystem.Instance.BlueObject.NetErrorText);
+            CommandSystem.Instance.Send(Command);
+            return;
+        }
+
         UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.SaveSpoitDataEnd);
         ((LoadingPanel)UIManager.Instance.GetUI(UINameConfig.LoadingPanel)).TextStr = str;
     }

+ 9 - 0
Assets/Scripts/UI/AnchorEditorPanel/UIAnchorsPanel.cs

@@ -90,6 +90,15 @@ public class UIAnchorsPanel : UIPanelBase
         JObject jObject = JObject.Parse(message);
         string str = jObject["message"].ToString();
 
+        if(str!="更新成功")
+        {
+            InstantiateCommand Command =new InstantiateCommand(
+                InstantiateSystem.Instance.BlueObject.WarningPopUp,
+                InstantiateSystem.Instance.BlueObject.NetErrorText);
+            CommandSystem.Instance.Send(Command);
+            return;
+        }
+
         UIManager.Instance.ShowUI(UINameConfig.LoadingPanel, typeof(LoadingPanel), (int)ELoadState.SaveSpoitDataEnd);
         ((LoadingPanel)UIManager.Instance.GetUI(UINameConfig.LoadingPanel)).TextStr = str;
     }

+ 9 - 1
Assets/Scripts/UI/EdirPanel/UIEditorPanel.cs

@@ -1,10 +1,11 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using Blue;
 using UnityEngine;
 using UnityEngine.UI;
 
-public class UIEditorPanel : MonoBehaviour, EventObserver
+public class UIEditorPanel : AbstractController, EventObserver
 {
 
     public event Action<GameObject> OnClickRemoveBtn;
@@ -228,7 +229,14 @@ public class UIEditorPanel : MonoBehaviour, EventObserver
         SaveBtn.onClick.AddListener(() =>
         {
             if (MaterialObj == null)
+            {
+                InstantiateCommand Command = new InstantiateCommand(
+                InstantiateSystem.Instance.BlueObject.WarningPopUp,
+                "保存失败\n服务器异常,请稍后重试");
+                CommandSystem.Instance.Send(Command);
+                //this.GetService<ISendLogService>().SendLog("Blue","请选择素材");
                 return;
+            }
             GameManager.Instance.SaveSpoitObjs();
 
         });