Browse Source

修改Coroutine、Instantiat、CommandSystem

蓝色星空 1 year ago
parent
commit
9e203db0f8

+ 1 - 1
Assets/Scripts/Blue/0.FrameworkDesign/Core/AbstractArchitecture.cs

@@ -15,7 +15,7 @@ namespace Blue
         private IOCContainer serviceContainer=new IOCContainer();
         private IOCContainer serviceContainer=new IOCContainer();
         private IOCContainer utilityContainer = new IOCContainer();
         private IOCContainer utilityContainer = new IOCContainer();
         private ITypeEventSystem eventSystem=new DefaultTypeEventSystem();
         private ITypeEventSystem eventSystem=new DefaultTypeEventSystem();
-        private ICommandHandler commandHandle=new DefaultCommandHandler();
+        private ICommandHandler commandHandle=new QueryDefault_Hand();
         private IQueryHandler queryHandler = new DefaultQueryHandler();
         private IQueryHandler queryHandler = new DefaultQueryHandler();
 
 
         /// <summary>
         /// <summary>

+ 8 - 0
Assets/Scripts/Blue/0.FrameworkDesign/Hand.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f97b2a2e9d3b4724e9a700e43f803b0e
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 15 - 18
Assets/Scripts/Blue/0.FrameworkDesign/Command/DefaultCommandHandler.cs → Assets/Scripts/Blue/0.FrameworkDesign/Hand/QueryDefault_Hand.cs

@@ -1,18 +1,15 @@
-namespace Blue
+namespace Blue
-{
+{
-    /// <summary>
+    public class QueryDefault_Hand : ICommandHandler
-    /// 默认Command 处理类
+    {
-    /// </summary>
+        public void ExcuteCommand(ICommand command)
-    public class DefaultCommandHandler : ICommandHandler
+        {
-    {
+            command.OnExcute();
-        public void ExcuteCommand(ICommand command)
+        }
-        {
+
-            command.OnExcute();
+        public void ExcuteCommand<T>() where T : ICommand, new()
-        }
+        {
-
+            ExcuteCommand(new T());
-        public void ExcuteCommand<T>() where T : ICommand, new()
+        }
-        {
+    }
-            ExcuteCommand(new T());
+}
-        }
-    }
-}

+ 1 - 1
Assets/Scripts/Blue/0.FrameworkDesign/Command/DefaultCommandHandler.cs.meta → Assets/Scripts/Blue/0.FrameworkDesign/Hand/QueryDefault_Hand.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
 fileFormatVersion: 2
-guid: b3d22e8c7927ea94ea756fbaf507eab4
+guid: f65ee8c3cb5750344add0dbe504ffe68
 MonoImporter:
 MonoImporter:
   externalObjects: {}
   externalObjects: {}
   serializedVersion: 2
   serializedVersion: 2

+ 1 - 1
Assets/Scripts/Blue/System/CommandExtensionSystem.cs → Assets/Scripts/Blue/System/CommandSystem.cs

@@ -1,6 +1,6 @@
 using Blue;
 using Blue;
 
 
-public class CommandExtensionSystem : SingletonMonobehaviour<CommandExtensionSystem>
+public class CommandSystem : SingletonMonobehaviour<CommandSystem>
 {
 {
     /// <summary>
     /// <summary>
     /// 发送命令
     /// 发送命令

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


+ 2 - 2
Assets/Scripts/Blue/System/RootSystem.cs → Assets/Scripts/Blue/System/CoroutineSystem.cs

@@ -2,7 +2,7 @@ using System.Collections;
 using UnityEngine;
 using UnityEngine;
 using Blue;
 using Blue;
 
 
-public class RootSystem : SingletonMonobehaviour<RootSystem>
+public class CoroutineSystem : SingletonMonobehaviour<CoroutineSystem>
 {
 {
     /// <summary>
     /// <summary>
     /// 启动一个协程
     /// 启动一个协程
@@ -19,4 +19,4 @@ public class RootSystem : SingletonMonobehaviour<RootSystem>
     {
     {
         StopCoroutine(routine);
         StopCoroutine(routine);
     }
     }
-}
+}

+ 0 - 0
Assets/Scripts/Blue/System/RootSystem.cs.meta → Assets/Scripts/Blue/System/CoroutineSystem.cs.meta


+ 5 - 1
Assets/Scripts/Blue/System/InstantiateSystem.cs

@@ -21,12 +21,16 @@ public class InstantiateSystem : SingletonMonobehaviour<InstantiateSystem>
         {
         {
             // 修改显示内容,并实例化到CenterCamera
             // 修改显示内容,并实例化到CenterCamera
             prefab.GetComponentInChildren<TextMeshProUGUI>().text = content;
             prefab.GetComponentInChildren<TextMeshProUGUI>().text = content;
+            /*
             GameObject CenterCamera = GameObject.Find("SDKSystem/NRCameraRig/CenterCamera");
             GameObject CenterCamera = GameObject.Find("SDKSystem/NRCameraRig/CenterCamera");
             if(CenterCamera!=null)
             if(CenterCamera!=null)
                 Instantiate(prefab, CenterCamera.transform);
                 Instantiate(prefab, CenterCamera.transform);
+            */
+            if (OpenXRCamera.Instance.head != null)
+                Instantiate(prefab, OpenXRCamera.Instance.head);
 
 
             // 关闭加载界面
             // 关闭加载界面
-            if(objDic.TryGetValue("LoadingPanel(Clone)",out GameObject LoadingPanel))
+            if (objDic.TryGetValue("LoadingPanel(Clone)",out GameObject LoadingPanel))
             {
             {
                 if (LoadingPanel.activeSelf)
                 if (LoadingPanel.activeSelf)
                     LoadingPanel.SetActive(false);
                     LoadingPanel.SetActive(false);