Browse Source

添加CommandExtensionSystem,UIPanelBase还原之前的继承,修改发送命令

蓝色星空 1 year ago
parent
commit
b1995428e1

+ 13 - 0
Assets/Prefabs/BluePrefabs/BlueRoot.prefab

@@ -11,6 +11,7 @@ GameObject:
   - component: {fileID: 8671475187487430762}
   - component: {fileID: 4456192713818240891}
   - component: {fileID: 1976901807331166432}
+  - component: {fileID: 5980049369778309861}
   m_Layer: 0
   m_Name: BlueRoot
   m_TagString: Untagged
@@ -60,6 +61,18 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   blueObject: {fileID: 11400000, guid: d2576af9f7ec3f744825e84161cd125b, type: 2}
+--- !u!114 &5980049369778309861
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 4520612451748474568}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 7edfff1461ac83640bd4012b59d97201, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
 --- !u!1 &7326868924308516955
 GameObject:
   m_ObjectHideFlags: 0

+ 3 - 2
Assets/Scripts/BaseManager/DataManager.cs

@@ -153,9 +153,10 @@ public class DataManager : SingletonMono<DataManager>
     {
         if (message == "UnityWebRequest Error")
         {
-            this.SendCommand(new InstantiateCommand(
+            InstantiateCommand Command= new InstantiateCommand(
                 InstantiateSystem.Instance.BlueObject.WarningPopUp,
-                InstantiateSystem.Instance.BlueObject.NetErrorText));
+                InstantiateSystem.Instance.BlueObject.NetErrorText);
+            CommandExtensionSystem.Instance.Send(Command);
             return;
         }
 

+ 1 - 1
Assets/Scripts/BaseManager/UIPanelBase.cs

@@ -1,6 +1,6 @@
 using System;
 using UnityEngine;
-public class UIPanelBase : AbstractController
+public class UIPanelBase : MonoBehaviour
 {
     private Transform m_Transform;
     private GameObject m_Go;

+ 1 - 1
Assets/Scripts/Blue/0.FrameworkDesign/Util/SingletonMonobehaviour.cs

@@ -2,7 +2,7 @@ using UnityEngine;
 
 namespace Blue
 {
-    public class SingletonMonobehaviour<T> : MonoBehaviour where T:SingletonMonobehaviour<T>
+    public class SingletonMonobehaviour<T> : AbstractController where T:SingletonMonobehaviour<T>
     {
         private static T _instance;
 

+ 12 - 0
Assets/Scripts/Blue/System/CommandExtensionSystem.cs

@@ -0,0 +1,12 @@
+using Blue;
+
+public class CommandExtensionSystem : SingletonMonobehaviour<CommandExtensionSystem>
+{
+    /// <summary>
+    /// 发送命令
+    /// </summary>
+    public void Send(ICommand command)
+    {
+        this.SendCommand(command);
+    }
+}

+ 11 - 0
Assets/Scripts/Blue/System/CommandExtensionSystem.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 7edfff1461ac83640bd4012b59d97201
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 3 - 2
Assets/Scripts/UI/AnchorEditorPanel/UIAnchorsPanel.cs

@@ -81,9 +81,10 @@ public class UIAnchorsPanel : UIPanelBase
     {
         if(message == "UnityWebRequest Error")
         {
-            this.SendCommand(new InstantiateCommand(
+            InstantiateCommand Command = new InstantiateCommand(
                 InstantiateSystem.Instance.BlueObject.WarningPopUp,
-                InstantiateSystem.Instance.BlueObject.NetErrorText));
+                InstantiateSystem.Instance.BlueObject.NetErrorText);
+            CommandExtensionSystem.Instance.Send(Command);
             return;
         }
         Debug.Log("SaveCallBack:  " + message);

+ 3 - 2
Assets/Scripts/UI/EdirPanel/UIMaterialsPanel.cs

@@ -285,9 +285,10 @@ public class UIMaterialsPanel : UIPanelBase, EventObserver
     {
         if (message == "UnityWebRequest Error")
         {
-            this.SendCommand(new InstantiateCommand(
+            InstantiateCommand Command =new InstantiateCommand(
                 InstantiateSystem.Instance.BlueObject.WarningPopUp,
-                InstantiateSystem.Instance.BlueObject.NetErrorText));
+                InstantiateSystem.Instance.BlueObject.NetErrorText);
+            CommandExtensionSystem.Instance.Send(Command);
             return;
         }