Browse Source

更新代码调用

蓝色星空 1 year ago
parent
commit
bc5024c357
100 changed files with 34 additions and 2449 deletions
  1. 1 1
      Assets/Plugins/Blue.meta
  2. BIN
      Assets/Plugins/Blue/Blue.dll
  3. 33 0
      Assets/Plugins/Blue/Blue.dll.meta
  4. 0 8
      Assets/Scripts/Blue/0.FrameworkDesign/Command.meta
  5. 0 18
      Assets/Scripts/Blue/0.FrameworkDesign/Command/DefaultCommandHandler.cs
  6. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Command/DefaultCommandHandler.cs.meta
  7. 0 7
      Assets/Scripts/Blue/0.FrameworkDesign/Command/ICommand.cs
  8. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Command/ICommand.cs.meta
  9. 0 8
      Assets/Scripts/Blue/0.FrameworkDesign/Command/ICommandHandler.cs
  10. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Command/ICommandHandler.cs.meta
  11. 0 8
      Assets/Scripts/Blue/0.FrameworkDesign/Core.meta
  12. 0 202
      Assets/Scripts/Blue/0.FrameworkDesign/Core/AbstractArchitecture.cs
  13. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Core/AbstractArchitecture.cs.meta
  14. 0 130
      Assets/Scripts/Blue/0.FrameworkDesign/Core/ArchitectureInitiator.cs
  15. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Core/ArchitectureInitiator.cs.meta
  16. 0 29
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IArchitecture.cs
  17. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IArchitecture.cs.meta
  18. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IArchitectureModule.cs
  19. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IArchitectureModule.cs.meta
  20. 0 36
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IArchitectureModuleExtension.cs
  21. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IArchitectureModuleExtension.cs.meta
  22. 0 6
      Assets/Scripts/Blue/0.FrameworkDesign/Core/ICanInject.cs
  23. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Core/ICanInject.cs.meta
  24. 0 9
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IController.cs
  25. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IController.cs.meta
  26. 0 10
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IModel.cs
  27. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IModel.cs.meta
  28. 0 10
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IService.cs
  29. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IService.cs.meta
  30. 0 9
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IUtility.cs
  31. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Core/IUtility.cs.meta
  32. 0 54
      Assets/Scripts/Blue/0.FrameworkDesign/Core/ModuleInitiator.cs
  33. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Core/ModuleInitiator.cs.meta
  34. BIN
      Assets/Scripts/Blue/0.FrameworkDesign/Design.eddx
  35. 0 7
      Assets/Scripts/Blue/0.FrameworkDesign/Design.eddx.meta
  36. 0 8
      Assets/Scripts/Blue/0.FrameworkDesign/Event.meta
  37. 0 22
      Assets/Scripts/Blue/0.FrameworkDesign/Event/BindablePropertyUnSubscribe.cs
  38. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/BindablePropertyUnSubscribe.cs.meta
  39. 0 41
      Assets/Scripts/Blue/0.FrameworkDesign/Event/ChainEventSubscription.cs
  40. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/ChainEventSubscription.cs.meta
  41. 0 27
      Assets/Scripts/Blue/0.FrameworkDesign/Event/DefaultChainEventUnSubcribe.cs
  42. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/DefaultChainEventUnSubcribe.cs.meta
  43. 0 160
      Assets/Scripts/Blue/0.FrameworkDesign/Event/DefaultTypeEventSystem.cs
  44. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/DefaultTypeEventSystem.cs.meta
  45. 0 49
      Assets/Scripts/Blue/0.FrameworkDesign/Event/EventToActionAdapter.cs
  46. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/EventToActionAdapter.cs.meta
  47. 0 8
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEvent.cs
  48. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEvent.cs.meta
  49. 0 18
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEventSubscription.cs
  50. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEventSubscription.cs.meta
  51. 0 31
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEventUnSubcribeExtension.cs
  52. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEventUnSubcribeExtension.cs.meta
  53. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEventUnSubscribe.cs
  54. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEventUnSubscribe.cs.meta
  55. 0 6
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IEvent.cs
  56. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IEvent.cs.meta
  57. 0 13
      Assets/Scripts/Blue/0.FrameworkDesign/Event/ISubscription.cs
  58. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/ISubscription.cs.meta
  59. 0 28
      Assets/Scripts/Blue/0.FrameworkDesign/Event/ITypeEventSystem.cs
  60. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/ITypeEventSystem.cs.meta
  61. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IUnSubscribe.cs
  62. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IUnSubscribe.cs.meta
  63. 0 26
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IUnSubscribeExtension.cs
  64. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/IUnSubscribeExtension.cs.meta
  65. 0 49
      Assets/Scripts/Blue/0.FrameworkDesign/Event/TypeEventSubscription.cs
  66. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/TypeEventSubscription.cs.meta
  67. 0 19
      Assets/Scripts/Blue/0.FrameworkDesign/Event/TypeEventSystemUnSubscribe.cs
  68. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/TypeEventSystemUnSubscribe.cs.meta
  69. 0 22
      Assets/Scripts/Blue/0.FrameworkDesign/Event/UnSubscribeChainEventOnDestroyTrigger.cs
  70. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/UnSubscribeChainEventOnDestroyTrigger.cs.meta
  71. 0 22
      Assets/Scripts/Blue/0.FrameworkDesign/Event/UnSubscribeOnDestroyTrigger.cs
  72. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/UnSubscribeOnDestroyTrigger.cs.meta
  73. 0 22
      Assets/Scripts/Blue/0.FrameworkDesign/Event/UnSubscribeOnDisableTrigger.cs
  74. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/Event/UnSubscribeOnDisableTrigger.cs.meta
  75. 0 8
      Assets/Scripts/Blue/0.FrameworkDesign/IOC.meta
  76. 0 236
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/AbstractArchitectureComponentInjector.cs
  77. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/AbstractArchitectureComponentInjector.cs.meta
  78. 0 132
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/ArchitectureInjecter.cs
  79. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/ArchitectureInjecter.cs.meta
  80. 0 36
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/AutoInjectAttribute.cs
  81. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/AutoInjectAttribute.cs.meta
  82. 0 54
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/ControllerInjector.cs
  83. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/ControllerInjector.cs.meta
  84. 0 19
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/IArchitectureComponentInjector.cs
  85. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/IArchitectureComponentInjector.cs.meta
  86. 0 19
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/IInjector.cs
  87. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/IInjector.cs.meta
  88. 0 65
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/IOCContainer.cs
  89. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/IOCContainer.cs.meta
  90. 0 13
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/InjectInfo.cs
  91. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/InjectInfo.cs.meta
  92. 0 40
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/InjectRuleAttribute.cs
  93. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/InjectRuleAttribute.cs.meta
  94. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/InjectScope.cs
  95. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/InjectScope.cs.meta
  96. 0 43
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/ModelInjector.cs
  97. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/ModelInjector.cs.meta
  98. 0 43
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/ServiceInjector.cs
  99. 0 11
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/ServiceInjector.cs.meta
  100. 0 79
      Assets/Scripts/Blue/0.FrameworkDesign/IOC/TypeChecker.cs

+ 1 - 1
Assets/Scripts/Blue/0.FrameworkDesign.meta → Assets/Plugins/Blue.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 77ed7435e9ea8ee4baa3ed85f70d94a0
+guid: 06f4576903578454a8f4f497b8fda9d5
 folderAsset: yes
 DefaultImporter:
   externalObjects: {}

BIN
Assets/Plugins/Blue/Blue.dll


+ 33 - 0
Assets/Plugins/Blue/Blue.dll.meta

@@ -0,0 +1,33 @@
+fileFormatVersion: 2
+guid: ce12ede5325fa0549b9337f00ba2771c
+PluginImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  iconMap: {}
+  executionOrder: {}
+  defineConstraints: []
+  isPreloaded: 0
+  isOverridable: 0
+  isExplicitlyReferenced: 0
+  validateReferences: 1
+  platformData:
+  - first:
+      Any: 
+    second:
+      enabled: 1
+      settings: {}
+  - first:
+      Editor: Editor
+    second:
+      enabled: 0
+      settings:
+        DefaultValueInitialized: true
+  - first:
+      Windows Store Apps: WindowsStoreApps
+    second:
+      enabled: 0
+      settings:
+        CPU: AnyCPU
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

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

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

+ 0 - 18
Assets/Scripts/Blue/0.FrameworkDesign/Command/DefaultCommandHandler.cs

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

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Command/DefaultCommandHandler.cs.meta

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

+ 0 - 7
Assets/Scripts/Blue/0.FrameworkDesign/Command/ICommand.cs

@@ -1,7 +0,0 @@
-namespace Blue
-{
-    public interface ICommand:ICanGetService,ICanGetModel,ICanGetUtility,ICanTriggerEvent,ICanSendCommand
-    {
-        void OnExcute();
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Command/ICommand.cs.meta

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

+ 0 - 8
Assets/Scripts/Blue/0.FrameworkDesign/Command/ICommandHandler.cs

@@ -1,8 +0,0 @@
-namespace Blue
-{
-    public interface ICommandHandler
-    {
-        void ExcuteCommand(ICommand command);
-        void ExcuteCommand<T>() where T:ICommand,new();
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Command/ICommandHandler.cs.meta

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

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

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

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

@@ -1,202 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Blue
-{
-    /// <summary>
-    /// Architecture抽象类,继承自IArchitecture
-    /// </summary>
-    public abstract class AbstractArchitecture<T>:IArchitecture where T:AbstractArchitecture<T>,new()
-    {
-        private static IArchitecture architectureInstance;
-        private List<IModel> modelList;
-        private List<IService> serviceList;
-        private IOCContainer modelContainer = new IOCContainer();
-        private IOCContainer serviceContainer=new IOCContainer();
-        private IOCContainer utilityContainer = new IOCContainer();
-        private ITypeEventSystem eventSystem=new DefaultTypeEventSystem();
-        private ICommandHandler commandHandle=new DefaultCommandHandler();
-        private IQueryHandler queryHandler = new DefaultQueryHandler();
-
-        /// <summary>
-        /// 设置Architecture_Instance
-        /// </summary>
-        void IArchitecture.SetArchitectureInstance(IArchitecture instance)
-        {
-            architectureInstance = instance;
-            ICanGetModelExtension.SetArchitecture(architectureInstance);
-            ICanGetServiceExtension.SetArchitecture(architectureInstance);
-            ICanGetUtilityExtension.SetArchitecture(architectureInstance);
-            IArchitectureModuleExtension.SetArchitecture(architectureInstance);
-            ICanSendCommandExtension.SetCommandHandler(commandHandle);
-            ICanTriggerEventExtension.SetEventSystem(eventSystem);
-            ICanSubscribeEventExtension.SetEventSystem(eventSystem);
-            IChainEventUnSubcribeExtension.SetEventSystem(eventSystem);
-            ICanSendQueryExtension.SetQueryHandler(queryHandler);
-        }
-
-        /// <summary>
-        /// 注册
-        /// </summary>
-        void IArchitecture.Register()
-        {
-            modelList = new List<IModel>();
-            serviceList = new List<IService>();
-            OnInit();
-        }
-
-        /// <summary>
-        /// 初始化Architecture
-        /// </summary>
-        void IArchitecture.InitArchitecture()
-        {
-            InitModels();
-            InitServices();
-        }
-
-        /// <summary>
-        /// 完成初始化Architecture
-        /// </summary>
-        void IArchitecture.FinishInit()
-        {
-            modelList.Clear();
-            serviceList.Clear();
-            modelList = null;
-            serviceList = null;
-        }
-
-        /// <summary>
-        /// 初始化 Model 层
-        /// </summary>
-        private void InitModels()
-        {
-            foreach (var model in modelList)
-            {
-                model.OnInit();
-            }
-            /*modelList.Clear();
-            modelList = null;*/
-        }
-
-        /// <summary>
-        /// 初始化 Services 层
-        /// </summary>
-        private void InitServices()
-        {
-            foreach (var service in serviceList)
-            {
-                service.OnInit();
-            }
-            /*serviceList.Clear();
-            serviceList = null;*/
-        }
-
-        protected abstract void OnInit();
-
-        /// <summary>
-        /// 设置事件系统
-        /// </summary>
-        protected virtual void SetTypeEventSystem(ITypeEventSystem typeEventSystem)
-        {
-            eventSystem = typeEventSystem;
-        }
-
-        /// <summary>
-        /// 获取 Model
-        /// </summary>
-        public K GetModel<K>() where K:IModel
-        {
-            return modelContainer.Get<K>();
-        }
-
-        /// <summary>
-        /// 获取 Service
-        /// </summary>
-        public K GetService<K>() where K : IService
-        {
-            return serviceContainer.Get<K>();
-        }
-
-        /// <summary>
-        /// 获取 Utility
-        /// </summary>
-        public K GetUtility<K>() where K : IUtility
-        {
-            return utilityContainer.Get<K>();
-        }
-
-        /// <summary>
-        /// 获取 Model
-        /// </summary>
-        public object GetModel(Type type)
-        {
-            return modelContainer.Get(type);
-        }
-
-        /// <summary>
-        /// 获取 Service
-        /// </summary>
-        public object GetService(Type type)
-        {
-            return serviceContainer.Get(type);
-        }
-
-        /// <summary>
-        /// 获取 Utility
-        /// </summary>
-        public object GetUtility(Type type)
-        {
-            return utilityContainer.Get(type);
-        }
-
-        /// <summary>
-        /// 注册 Model
-        /// </summary>
-        public void RegisterModel<K>() where K :  IModel, new()
-        {
-            RegisterModel(new K());
-        }
-
-        /// <summary>
-        /// 注册 Service
-        /// </summary>
-        public void RegisterService<K>() where K : IService, new()
-        {
-            RegisterService(new K());
-        }
-
-        /// <summary>
-        /// 注册 Utility
-        /// </summary>
-        public void RegisterUtility<K>() where K : IUtility, new()
-        {
-            RegisterUtility(new K());
-        }
-
-        /// <summary>
-        /// 注册 Model
-        /// </summary>
-        public void RegisterModel<K>(K modelInstance) where K : IModel
-        {
-            modelContainer.Register(modelInstance);
-            modelList.Add(modelInstance);
-        }
-
-        /// <summary>
-        /// 注册 Service
-        /// </summary>
-        public void RegisterService<K>(K serviceInstance) where K : IService
-        {
-            serviceContainer.Register(serviceInstance);
-            serviceList.Add(serviceInstance);
-        }
-
-        /// <summary>
-        /// 注册 Utility
-        /// </summary>
-        public void RegisterUtility<K>(K utilityInstance) where K : IUtility
-        {
-            utilityContainer.Register(utilityInstance);
-        }
-    }
-}

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

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

+ 0 - 130
Assets/Scripts/Blue/0.FrameworkDesign/Core/ArchitectureInitiator.cs

@@ -1,130 +0,0 @@
-using System;
-using System.Reflection;
-using UnityEngine;
-using UnityEngine.Scripting;
-
-namespace Blue
-{
-    [Preserve]
-    internal sealed class ArchitectureInitiator
-    {
-        private ArchitectureInitiator() { }
-
-        private Type architectureType = typeof(IArchitecture);
-        private IArchitecture architectureInstance = null;
-        private IInjector mInjector;
-        private bool architectureInited = false;
-        //private bool
-        private static ArchitectureInitiator mInstance;
-        private ModuleInitiator moduleInitiator;
-
-        [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterAssembliesLoaded)]
-        private static void Initiate()
-        {
-            mInstance = new ArchitectureInitiator();
-            mInstance.CreateInjector();
-            mInstance.CreateModuleInitiator();
-            Type[] typeArr = Assembly.GetExecutingAssembly().GetTypes();
-            int typeLength = typeArr.Length;
-            for (int i = 0; i < typeLength; i++)
-            {
-                Type tmpType = typeArr[i];
-                if (!tmpType.IsInterface) 
-                {
-                    if (mInstance.IsArchitecture(tmpType))
-                    {
-                        mInstance.CreateArchitectureInstance(tmpType);
-                    }
-                    mInstance.PrepairModuleData(tmpType);
-                    mInstance.PrepairInjectionData(tmpType);
-                }
-            }
-            mInstance.RegisterArchitecture();
-            StartInject();
-            mInstance.InitArchitecture();
-            mInstance.FinishInit();
-        }
-        //[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
-        private static void StartInject() 
-        {
-            Debug.Log("StartInject");
-            mInstance.Inject();
-            //mInstance.Clear();
-        }
-        private void Clear() 
-        {
-            mInjector.Dispose();
-            moduleInitiator.Dispose();
-            mInjector = null;
-            moduleInitiator = null;
-            mInstance = null;
-        }
-        private void Inject() 
-        {
-            mInjector.Inject(architectureInstance);
-        }
-        private void FinishInit()
-        {
-            architectureInstance.FinishInit();
-            mInstance.Clear();
-        }
-        private void RegisterArchitecture()
-        {
-            if (architectureInstance != null)
-            {
-                architectureInstance.SetArchitectureInstance(architectureInstance);
-                architectureInstance.Register();
-                InitModule();
-            }
-        }
-        private void InitArchitecture()
-        {
-            architectureInstance.InitArchitecture();
-        }
-        private void InitModule() 
-        {
-            moduleInitiator.InitModule();
-        }
-        private bool IsArchitecture(Type tmpType)
-        {
-            if (architectureInited) 
-            {
-                return false;
-            }
-            if (tmpType.IsAbstract)
-            {
-                return false;
-            }
-            return architectureType.IsAssignableFrom(tmpType);
-        }
-        private void PrepairModuleData(Type type) 
-        {
-            moduleInitiator.PrepairModuleData(type);
-        }
-
-        private void CreateArchitectureInstance(Type archiType)
-        {
-            if (architectureInstance == null)
-            {
-                architectureInstance = (IArchitecture)Activator.CreateInstance(archiType);
-                architectureInited = true;
-            }
-            else
-            {
-                throw new Exception("More than one Architecture sub-class in the application,it should be only one!");
-            }
-        }
-        private void PrepairInjectionData(Type type) 
-        {
-            mInjector.PrepairInjectionData(type);
-        }
-        private void CreateModuleInitiator() 
-        {
-            moduleInitiator=new ModuleInitiator();
-        }
-        private void CreateInjector() 
-        {
-            mInjector = new ArchitectureInjecter();
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Core/ArchitectureInitiator.cs.meta

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

+ 0 - 29
Assets/Scripts/Blue/0.FrameworkDesign/Core/IArchitecture.cs

@@ -1,29 +0,0 @@
-using System;
-using UnityEngine.Scripting;
-namespace Blue
-{
-    /// <summary>
-    /// Architecture 接口
-    /// </summary>
-    [RequireImplementors]
-    public interface IArchitecture
-    {
-        void SetArchitectureInstance(IArchitecture instance);
-        void Register();
-        void InitArchitecture();
-        void FinishInit();
-        T GetService<T>() where T : IService;
-        T GetModel<T>() where T : IModel;
-        T GetUtility<T>() where T : IUtility;
-        object GetService(Type type);
-        object GetModel(Type type);
-        object GetUtility(Type type);
-        void RegisterService<T>() where T : IService,new();
-        void RegisterModel<T>() where T : IModel,new();
-        void RegisterUtility<T>() where T : IUtility,new();
-
-        void RegisterModel<T>(T modelInstance) where T : IModel;
-        void RegisterService<T>(T serviceInstance) where T : IService;
-        void RegisterUtility<T>(T utilityInstance) where T : IUtility;
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Core/IArchitecture.cs.meta

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

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Core/IArchitectureModule.cs

@@ -1,11 +0,0 @@
-namespace Blue
-{
-    /// <summary>
-    /// 模块的基本接口
-    /// 所有模块都需要继承此接口并实现
-    /// </summary>
-    public interface IArchitectureModule
-    {
-        void OnInit();
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Core/IArchitectureModule.cs.meta

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

+ 0 - 36
Assets/Scripts/Blue/0.FrameworkDesign/Core/IArchitectureModuleExtension.cs

@@ -1,36 +0,0 @@
-namespace Blue
-{
-    public static class IArchitectureModuleExtension
-    {
-        private static IArchitecture _architecture;
-        public static void SetArchitecture(IArchitecture architecture)
-        {
-            _architecture = architecture;
-        }
-        public static void RegisterModel<T>(this IArchitectureModule self) where T : IModel, new()
-        {
-            _architecture.RegisterModel<T>();
-        }
-        public static void RegisterModel<T>(this IArchitectureModule self,T modelInstance) where T : IModel
-        {
-            _architecture.RegisterModel<T>(modelInstance);
-        }
-
-        public static void RegisterService<T>(this IArchitectureModule self) where T:IService,new()
-        {
-            _architecture.RegisterService<T>();
-        }
-        public static void RegisterService<T>(this IArchitectureModule self,T serviceInstance) where T : IService
-        {
-            _architecture.RegisterService<T>(serviceInstance);
-        }
-        public static void RegisterUtility<T>(this IArchitectureModule self) where T : IUtility, new()
-        {
-            _architecture.RegisterUtility<T>();
-        }
-        public static void RegisterUtility<T>(this IArchitectureModule self, T utilityInstance) where T : IUtility
-        {
-            _architecture.RegisterUtility<T>(utilityInstance);
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Core/IArchitectureModuleExtension.cs.meta

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

+ 0 - 6
Assets/Scripts/Blue/0.FrameworkDesign/Core/ICanInject.cs

@@ -1,6 +0,0 @@
-namespace Blue
-{
-    public interface ICanInject
-    {
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Core/ICanInject.cs.meta

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

+ 0 - 9
Assets/Scripts/Blue/0.FrameworkDesign/Core/IController.cs

@@ -1,9 +0,0 @@
-namespace Blue
-{
-    /// <summary>
-    /// Controller 层接口
-    /// </summary>
-    public interface IController :ICanInject,ICanGetService,ICanGetModel,ICanGetUtility,ICanSendCommand,ICanSubscribeEvent,ICanSendQuery
-    {
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Core/IController.cs.meta

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

+ 0 - 10
Assets/Scripts/Blue/0.FrameworkDesign/Core/IModel.cs

@@ -1,10 +0,0 @@
-namespace Blue
-{
-    /// <summary>
-    /// Model 层接口
-    /// </summary>
-    public interface IModel:ICanInject,ICanGetUtility,ICanTriggerEvent
-    {
-        void OnInit();
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Core/IModel.cs.meta

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

+ 0 - 10
Assets/Scripts/Blue/0.FrameworkDesign/Core/IService.cs

@@ -1,10 +0,0 @@
-namespace Blue
-{
-    /// <summary>
-    /// Service 层接口
-    /// </summary>
-    public interface IService : ICanInject,ICanGetService, ICanSendCommand,ICanGetModel, ICanGetUtility,ICanSubscribeEvent,ICanTriggerEvent,ICanSendQuery
-    {
-        void OnInit();
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Core/IService.cs.meta

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

+ 0 - 9
Assets/Scripts/Blue/0.FrameworkDesign/Core/IUtility.cs

@@ -1,9 +0,0 @@
-namespace Blue
-{
-    /// <summary>
-    /// Utility 层接口
-    /// </summary>
-    public interface IUtility:ICanInject,ICanGetUtility
-    {
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Core/IUtility.cs.meta

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

+ 0 - 54
Assets/Scripts/Blue/0.FrameworkDesign/Core/ModuleInitiator.cs

@@ -1,54 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Blue
-{
-    public class ModuleInitiator:IDisposable
-    {
-        private Type moduleInterfaceType;
-        private List<Type> moduleList;
-        public ModuleInitiator() 
-        {
-            moduleInterfaceType = typeof(IArchitectureModule);
-            moduleList = new List<Type>();
-        }
-        public void PrepairModuleData(Type type) 
-        {
-            if (IsModule(type)) 
-            {
-                moduleList.Add(type);
-            }
-        }
-        public void InitModule() 
-        {
-            int moduleCount = moduleList.Count;
-            if (moduleCount == 0) 
-            {
-                return;
-            }
-            for (int i = 0; i < moduleCount; i++)
-            {
-                IArchitectureModule module =(IArchitectureModule)Activator.CreateInstance(moduleList[i]);
-                module.OnInit();
-            }
-        }
-
-        public void Dispose() 
-        {
-            moduleInterfaceType = null;
-            moduleList = null;
-        }
-        private bool IsModule(Type type)
-        {
-            if (type.IsInterface)
-            {
-                return false;
-            }
-            if (type.IsAbstract)
-            {
-                return false;
-            }
-            return moduleInterfaceType.IsAssignableFrom(type);
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Core/ModuleInitiator.cs.meta

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

BIN
Assets/Scripts/Blue/0.FrameworkDesign/Design.eddx


+ 0 - 7
Assets/Scripts/Blue/0.FrameworkDesign/Design.eddx.meta

@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: 2b7919ae31a57be4fbcef440aece1f8b
-DefaultImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

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

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

+ 0 - 22
Assets/Scripts/Blue/0.FrameworkDesign/Event/BindablePropertyUnSubscribe.cs

@@ -1,22 +0,0 @@
-using System;
-namespace Blue
-{
-    public struct BindablePropertyUnSubscribe<T> : IUnSubscribe
-    {
-        private Action<T> _onPropertyChanged;
-        private BindableProperty<T> _property;
-
-        public BindablePropertyUnSubscribe(BindableProperty<T> property,Action<T> onPropertyChanged) 
-        {
-            _property = property;
-            _onPropertyChanged = onPropertyChanged;
-        }
-
-        public void UnSubscribe()
-        {
-            _property.UnSubscribe(_onPropertyChanged);
-            _property = null;
-            _onPropertyChanged = null;
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/BindablePropertyUnSubscribe.cs.meta

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

+ 0 - 41
Assets/Scripts/Blue/0.FrameworkDesign/Event/ChainEventSubscription.cs

@@ -1,41 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-
-namespace Blue {
-    public class ChainEventSubscription : IChainEventSubscription
-    {
-        private Dictionary<Type, int> actionHashPool;
-        private Type mChainEventType;
-        public ChainEventSubscription(Type chainEventType)
-        {
-            mChainEventType = chainEventType;
-        }
-        public int SubscribeCount => actionHashPool.Count;
-
-        public IChainEventUnSubscribe Subscribe(Type eventType,int actionHashCode,Action onOnSubscribe)
-        {
-            actionHashPool.TryAdd(eventType, actionHashCode);
-            return new DefaultChainEventUnSubcribe(mChainEventType, () => { onOnSubscribe?.Invoke(); UnSubscribe(eventType); });
-        }
-        public bool IsSubscribed(Type eventType)
-        {
-            return actionHashPool.ContainsKey(eventType);
-        }
-        public int GetActionHashCode(Type eventType)
-        {
-            return actionHashPool[eventType];
-        }
-        public List<Type> GetEventTypeList()
-        {
-            List<Type> valueList = new List<Type>(actionHashPool.Count);
-            valueList.AddRange(actionHashPool.Keys);
-            return valueList;
-        }
-
-        public bool UnSubscribe(Type eventType)
-        {
-            return actionHashPool.Remove(eventType);
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/ChainEventSubscription.cs.meta

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

+ 0 - 27
Assets/Scripts/Blue/0.FrameworkDesign/Event/DefaultChainEventUnSubcribe.cs

@@ -1,27 +0,0 @@
-using System;
-namespace Blue
-{
-
-    public class DefaultChainEventUnSubcribe : IChainEventUnSubscribe
-    {
-        private Action mOnUnSub;
-        private Type mChainEventType;
-        public DefaultChainEventUnSubcribe(Type chainEventType,Action onUnSub)
-        {
-            mChainEventType = chainEventType;
-            mOnUnSub = onUnSub;
-        }
-
-        public Type GetChainEventType()
-        {
-            return mChainEventType;
-        }
-
-        public void UnSubscribe()
-        {
-            mOnUnSub?.Invoke();
-            mOnUnSub = null;
-            mChainEventType = null;
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/DefaultChainEventUnSubcribe.cs.meta

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

+ 0 - 160
Assets/Scripts/Blue/0.FrameworkDesign/Event/DefaultTypeEventSystem.cs

@@ -1,160 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Blue
-{
-    /// <summary>
-    /// 默认事件系统类,实现ITypeEventSystem
-    /// </summary>
-    public class DefaultTypeEventSystem : ITypeEventSystem
-    {
-        private Dictionary<Type, ISubscription> eventSubscriptionPool = new Dictionary<Type, ISubscription>(128);
-        private Dictionary<Type, IChainEventSubscription> chainEventPool = new Dictionary<Type, IChainEventSubscription>(8);
-        public IUnSubscribe SubscribeEvent<T>(Action<T> onEvent) where T : IEvent
-        {
-            Type t = typeof(T);
-            ISubscription subscription;
-            var adapter = new EventToActionAdapter(onEvent.GetHashCode(),(ievent) => { onEvent?.Invoke((T)ievent); });
-            if (!eventSubscriptionPool.TryGetValue(t, out subscription))
-            {
-                subscription = new TypeEventSubscription(t);
-                eventSubscriptionPool.Add(t, subscription);
-            }
-            return subscription.Subscribe(adapter);
-        }
-
-        public IChainEventUnSubscribe SubscribeChainEvent<T,K>(Action<K> onEvent) where T : IChainEvent where K:IEvent
-        {
-            Type chainEventType = typeof(T);
-            return SubscribeChainEvent(chainEventType,onEvent);
-        }
-        public IChainEventUnSubscribe SubscribeChainEvent<K>(Type chainEventType, Action<K> onEvent) where K : IEvent 
-        {
-            Type eventType = typeof(K);
-            IChainEventSubscription chainSubscription;
-            if (!chainEventPool.TryGetValue(chainEventType, out chainSubscription))
-            {
-                chainSubscription = new ChainEventSubscription(chainEventType);
-                chainEventPool.Add(chainEventType, chainSubscription);
-            }
-            if (chainSubscription.IsSubscribed(eventType))
-            {
-                UnSubscribeEvent(eventType, chainSubscription.GetActionHashCode(eventType));
-                chainSubscription.UnSubscribe(eventType);
-            }
-            ISubscription eventSubscription;
-            var adapter = new EventToActionAdapter(onEvent.GetHashCode(), (ievent) => { onEvent?.Invoke((K)ievent); });
-            if (!eventSubscriptionPool.TryGetValue(eventType, out eventSubscription))
-            {
-                eventSubscription = new TypeEventSubscription(eventType);
-                eventSubscriptionPool.Add(eventType, eventSubscription);
-            }
-            eventSubscription.Subscribe(adapter);
-            return chainSubscription.Subscribe(eventType, onEvent.GetHashCode(),()=> { eventSubscription.UnSubscribe(onEvent.GetHashCode()); });
-        }
-        public void TriggerEvent<T>() where T : IEvent, new()
-        {
-            TriggerEvent(new T());
-        }
-
-        public void TriggerEvent<T>(T e) where T : IEvent
-        {
-            if (eventSubscriptionPool.TryGetValue(e.GetType(), out ISubscription subscription))
-            {
-                subscription.TriggerEvent(e);
-            }
-        }
-
-        public void TriggerChainEvent<T>(params IEvent[] events) where T:IChainEvent
-        {
-            IChainEventSubscription chainSubscription;
-            Type chainEventType = typeof(T);
-            if (chainEventPool.TryGetValue(chainEventType, out chainSubscription))
-            {
-                Dictionary<Type, IEvent> eventInstanceMap = new Dictionary<Type, IEvent>(events.Length);
-                foreach (var mEvent in events)
-                {
-                    eventInstanceMap.TryAdd(mEvent.GetType(),mEvent);
-                }
-                List<Type> chainEventTypeList=chainSubscription.GetEventTypeList();
-                foreach (var eventType in chainEventTypeList)
-                {
-                    IEvent eventInstance;
-                    if (!eventInstanceMap.TryGetValue(eventType, out eventInstance))
-                    {
-                        eventInstance = (IEvent)Activator.CreateInstance(eventType);
-                    }
-                    TriggerEvent(eventInstance);
-                }
-            }
-        }
-        public void TriggerChainEvent<T>() where T : IChainEvent
-        {
-            IChainEventSubscription chainSubscription;
-            Type chainEventType = typeof(T);
-            if (chainEventPool.TryGetValue(chainEventType, out chainSubscription))
-            {
-                List<Type> chainEventTypeList = chainSubscription.GetEventTypeList();
-                foreach (var eventType in chainEventTypeList)
-                {
-                    TriggerEvent((IEvent)Activator.CreateInstance(eventType));
-                }
-            }
-        }
-
-        public void UnSubscribeEvent<T>(Action<T> onEvent) where T : IEvent
-        {
-            Type t = typeof(T);
-            UnSubscribeEvent(t, onEvent.GetHashCode());
-        }
-        public void UnSubscribeChainEvent<T>() where T:IChainEvent
-        {
-            Type chainEventType = typeof(T);
-            UnSubscribeChainEvent(chainEventType);
-        }
-        public void UnSubscribeChainEvent(Type chainEventType)
-        {
-            IChainEventSubscription chainSubscription;
-            if (chainEventPool.TryGetValue(chainEventType, out chainSubscription))
-            {
-                List<Type> chainEventTypeList= chainSubscription.GetEventTypeList();
-                foreach (var eventType in chainEventTypeList)
-                {
-                    UnSubscribeEvent(eventType,chainSubscription.GetActionHashCode(eventType));
-                    chainSubscription.UnSubscribe(eventType);
-                }
-                chainEventPool.Remove(chainEventType);
-            }
-        }
-        public void UnSubscribeEventFromChainEvent<T, K>() where T : IChainEvent where K : IEvent
-        {
-            IChainEventSubscription chainSubscription;
-            Type chainEventType = typeof(T);
-            if (chainEventPool.TryGetValue(chainEventType, out chainSubscription))
-            {
-                Type eventType = typeof(K);
-                if (chainSubscription.UnSubscribe(eventType))
-                {
-                    UnSubscribeEvent(eventType,chainSubscription.GetActionHashCode(eventType));
-                }
-                if (chainSubscription.SubscribeCount == 0)
-                {
-                    chainEventPool.Remove(chainEventType);
-                }
-            }
-        }
-        private bool UnSubscribeEvent(Type eventType, int hash)
-        {
-            bool result = false;
-            if (eventSubscriptionPool.TryGetValue(eventType, out ISubscription subscription))
-            {
-                result=subscription.UnSubscribe(hash);
-                if (subscription.SubscribeCount <= 0)
-                {
-                    eventSubscriptionPool.Remove(eventType);
-                }
-            }
-            return result;
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/DefaultTypeEventSystem.cs.meta

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

+ 0 - 49
Assets/Scripts/Blue/0.FrameworkDesign/Event/EventToActionAdapter.cs

@@ -1,49 +0,0 @@
-using System;
-namespace Blue
-{
-    /// <summary>
-    /// Event Action 适配
-    /// </summary>
-    public struct EventToActionAdapter
-    {
-        private Action<IEvent> mAdapterAction;
-        private int mHashCode;
-
-        /// <summary>
-        /// 初始化 hashCode ,Action
-        /// </summary>
-        /// <param name="hashCode"></param>
-        /// <param name="adapterAction"></param>
-        public EventToActionAdapter(int hashCode,Action<IEvent> adapterAction)
-        {
-            mHashCode = hashCode;
-            mAdapterAction = adapterAction;
-        }
-
-        /// <summary>
-        /// 获取适配的 Action
-        /// </summary>
-        /// <returns></returns>
-        public Action<IEvent> GetAdapterAction()
-        {
-            return mAdapterAction;
-        }
-
-        /// <summary>
-        /// 获取 Action 的 HashCode
-        /// </summary>
-        /// <returns></returns>
-        public int GetActionHashCode()
-        {
-            return mHashCode;
-        }
-
-        /// <summary>
-        /// 清除 Action
-        /// </summary>
-        public void Clear()
-        {
-            mAdapterAction = null;
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/EventToActionAdapter.cs.meta

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

+ 0 - 8
Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEvent.cs

@@ -1,8 +0,0 @@
-using System;
-namespace Blue
-{
-    public interface IChainEvent : IEvent
-    {
-        //IChainEvent NextEvent<T>(Action<T> onEvent) where T : IEvent;
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEvent.cs.meta

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

+ 0 - 18
Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEventSubscription.cs

@@ -1,18 +0,0 @@
-using System;
-using System.Collections.Generic;
-
-namespace Blue
-{
-	/// <summary>
-	/// 订阅链事件的接口
-	/// </summary>
-	public interface IChainEventSubscription
-	{
-		int SubscribeCount { get; }
-		IChainEventUnSubscribe Subscribe(Type eventType, int actionHashCode, Action onOnSubscribe);
-		List<Type> GetEventTypeList();
-		bool IsSubscribed(Type eventType);
-		int GetActionHashCode(Type eventType);
-		bool UnSubscribe(Type eventType);
-	}
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEventSubscription.cs.meta

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

+ 0 - 31
Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEventUnSubcribeExtension.cs

@@ -1,31 +0,0 @@
-using System;
-using UnityEngine;
-namespace Blue
-{
-    public static class IChainEventUnSubcribeExtension
-    {
-        private static ITypeEventSystem _typeEventSystem;
-        public static void SetEventSystem(ITypeEventSystem typeEventSystem) 
-        {
-            _typeEventSystem = typeEventSystem;
-        }
-        public static void UnSubscribeAllEventOnGameobjectDestroyed(this IChainEventUnSubscribe unSubscribe, GameObject gameObject)
-        {
-            var trigger = gameObject.GetComponent<UnSubscribeChainEventOnDestroyTrigger>();
-            if (!trigger)
-            {
-                trigger = gameObject.AddComponent<UnSubscribeChainEventOnDestroyTrigger>();
-            }
-            trigger.AddUnSubscribe(unSubscribe);
-        }
-        public static IChainEventUnSubscribe NextEvent<T>(this IChainEventUnSubscribe self,Action<T> onEvent) where T:IEvent
-        {
-            return _typeEventSystem.SubscribeChainEvent(self.GetChainEventType(),onEvent);
-        }
-
-        public static void UnSubscribeAllEventsOnChain(this IChainEventUnSubscribe self) 
-        {
-            _typeEventSystem.UnSubscribeChainEvent(self.GetChainEventType());
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEventUnSubcribeExtension.cs.meta

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

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEventUnSubscribe.cs

@@ -1,11 +0,0 @@
-using System;
-namespace Blue
-{
-    /// <summary>
-    /// 链事件取消订阅事件的接口
-    /// </summary>
-    public interface IChainEventUnSubscribe:IUnSubscribe
-    {
-        Type GetChainEventType();
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/IChainEventUnSubscribe.cs.meta

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

+ 0 - 6
Assets/Scripts/Blue/0.FrameworkDesign/Event/IEvent.cs

@@ -1,6 +0,0 @@
-namespace Blue
-{
-    public interface IEvent
-    {
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/IEvent.cs.meta

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

+ 0 - 13
Assets/Scripts/Blue/0.FrameworkDesign/Event/ISubscription.cs

@@ -1,13 +0,0 @@
-namespace Blue
-{
-    /// <summary>
-    /// 订阅事件的接口
-    /// </summary>
-    public interface ISubscription
-    {
-        int SubscribeCount { get; }
-        IUnSubscribe Subscribe(EventToActionAdapter adapter);
-        bool UnSubscribe(int hashCode);
-        void TriggerEvent(IEvent e);
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/ISubscription.cs.meta

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

+ 0 - 28
Assets/Scripts/Blue/0.FrameworkDesign/Event/ITypeEventSystem.cs

@@ -1,28 +0,0 @@
-using System;
-namespace Blue
-{
-    /// <summary>
-    /// 事件系统接口
-    /// ① 注册事件、注册链事件
-    /// ② 订阅事件、订阅链事件
-    /// ③ 取消订阅事件、取消订阅链事件
-    /// ④ 取消订阅链事件中的事件
-    /// </summary>
-    public interface ITypeEventSystem
-    {
-        void TriggerEvent<T>() where T : IEvent, new();
-        void TriggerEvent<T>(T e) where T : IEvent;
-        void TriggerChainEvent<T>(params IEvent[] events) where T : IChainEvent;
-        void TriggerChainEvent<T>() where T : IChainEvent;
-
-        IUnSubscribe SubscribeEvent<T>(Action<T> onEvent) where T : IEvent;
-        IChainEventUnSubscribe SubscribeChainEvent<T, K>(Action<K> onEvent) where T : IChainEvent where K : IEvent;
-        IChainEventUnSubscribe SubscribeChainEvent<K>(Type chainEventType,Action<K> onEvent) where K : IEvent;
-
-        void UnSubscribeEvent<T>(Action<T> onEvent) where T : IEvent;
-        void UnSubscribeChainEvent<T>() where T : IChainEvent;
-        void UnSubscribeChainEvent(Type chainEventType);
-
-        void UnSubscribeEventFromChainEvent<T, K>() where T : IChainEvent where K : IEvent;
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/ITypeEventSystem.cs.meta

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

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/IUnSubscribe.cs

@@ -1,11 +0,0 @@
-using System;
-namespace Blue
-{
-    /// <summary>
-    /// 取消订阅事件的接口
-    /// </summary>
-    public interface IUnSubscribe
-    {
-        void UnSubscribe();
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/IUnSubscribe.cs.meta

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

+ 0 - 26
Assets/Scripts/Blue/0.FrameworkDesign/Event/IUnSubscribeExtension.cs

@@ -1,26 +0,0 @@
-using UnityEngine;
-namespace Blue
-{
-    public static class IUnSubscribeExtension
-    {
-        public static void UnSubScribeWhenGameObjectDestroyed(this  IUnSubscribe unSubscribe,GameObject gameObject) 
-        {
-            var trigger= gameObject.GetComponent<UnSubscribeOnDestroyTrigger>();
-            if (!trigger) 
-            {
-                trigger = gameObject.AddComponent<UnSubscribeOnDestroyTrigger>();
-            }
-            trigger.AddUnSubscribe(unSubscribe);
-        }
-        public static void UnSubScribeWhenGameObjectDisabled(this IUnSubscribe unSubscribe, GameObject gameObject)
-        {
-            var trigger = gameObject.GetComponent<UnSubscribeOnDisableTrigger>();
-            if (!trigger)
-            {
-                trigger = gameObject.AddComponent<UnSubscribeOnDisableTrigger>();
-            }
-            trigger.AddUnSubscribe(unSubscribe);
-        }
-
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/IUnSubscribeExtension.cs.meta

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

+ 0 - 49
Assets/Scripts/Blue/0.FrameworkDesign/Event/TypeEventSubscription.cs

@@ -1,49 +0,0 @@
-using System;
-using System.Collections.Generic;
-namespace Blue
-{
-    public class TypeEventSubscription : ISubscription
-    {
-        private Action<IEvent> mOnEvent;
-        private int subscribeCount;
-        private Type mEventType;
-        private Dictionary<int, EventToActionAdapter> adapterPool = new Dictionary<int, EventToActionAdapter>();
-        public TypeEventSubscription(Type eventType) 
-        {
-            mEventType = eventType;
-        }
-        public int SubscribeCount { get => subscribeCount;}
-        public IUnSubscribe Subscribe(EventToActionAdapter adapter)
-        {
-            try
-            {
-                adapterPool.Add(adapter.GetActionHashCode(), adapter);
-                mOnEvent += adapter.GetAdapterAction();
-                subscribeCount++;
-                return new TypeEventSystemUnSubscribe(() => { UnSubscribe(adapter.GetActionHashCode()); });
-            }
-            catch (ArgumentException)
-            {
-                //LogUtil.LogError("Event subscription duplicated on "+mEventType+",please make sure you have unsubscribe it before re-subscribe!");
-                throw;
-            }
-        }
-        public void TriggerEvent(IEvent e)
-        {
-            mOnEvent?.Invoke(e);
-        }
-
-        public bool UnSubscribe(int hashCode)
-        {
-            if (adapterPool.TryGetValue(hashCode, out var adapter)) 
-            {
-                mOnEvent -= adapter.GetAdapterAction();
-                subscribeCount--;
-                adapter.Clear();
-                adapterPool.Remove(hashCode);
-                return true;
-            }
-            return false;
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/TypeEventSubscription.cs.meta

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

+ 0 - 19
Assets/Scripts/Blue/0.FrameworkDesign/Event/TypeEventSystemUnSubscribe.cs

@@ -1,19 +0,0 @@
-using System;
-
-namespace Blue
-{
-
-    public struct TypeEventSystemUnSubscribe : IUnSubscribe
-    {
-        private Action mOnUnSubscribe;
-        public TypeEventSystemUnSubscribe(Action onUnSubscribe) 
-        {
-            mOnUnSubscribe = onUnSubscribe;
-        }
-        public void UnSubscribe() 
-        {
-            mOnUnSubscribe?.Invoke();
-            mOnUnSubscribe = null;
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/TypeEventSystemUnSubscribe.cs.meta

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

+ 0 - 22
Assets/Scripts/Blue/0.FrameworkDesign/Event/UnSubscribeChainEventOnDestroyTrigger.cs

@@ -1,22 +0,0 @@
-using System.Collections.Generic;
-using UnityEngine;
-namespace Blue
-{
-    public class UnSubscribeChainEventOnDestroyTrigger : MonoBehaviour
-    {
-        private HashSet<IChainEventUnSubscribe> unSubscribes = new HashSet<IChainEventUnSubscribe>();
-
-        public void AddUnSubscribe(IChainEventUnSubscribe unSubscribe)
-        {
-            unSubscribes.Add(unSubscribe);
-        }
-        private void OnDestroy()
-        {
-            foreach (var item in unSubscribes)
-            {
-                item.UnSubscribeAllEventsOnChain();
-            }
-            unSubscribes.Clear();
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/UnSubscribeChainEventOnDestroyTrigger.cs.meta

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

+ 0 - 22
Assets/Scripts/Blue/0.FrameworkDesign/Event/UnSubscribeOnDestroyTrigger.cs

@@ -1,22 +0,0 @@
-using System.Collections.Generic;
-using UnityEngine;
-namespace Blue
-{
-    public class UnSubscribeOnDestroyTrigger : MonoBehaviour
-    {
-        private HashSet<IUnSubscribe> unSubscribes = new HashSet<IUnSubscribe>();
-
-        public void AddUnSubscribe(IUnSubscribe unSubscribe) 
-        {
-            unSubscribes.Add(unSubscribe);
-        }
-        private void OnDestroy()
-        {
-            foreach (var item in unSubscribes)
-            {
-                item.UnSubscribe();
-            }
-            unSubscribes.Clear();
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/UnSubscribeOnDestroyTrigger.cs.meta

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

+ 0 - 22
Assets/Scripts/Blue/0.FrameworkDesign/Event/UnSubscribeOnDisableTrigger.cs

@@ -1,22 +0,0 @@
-using System.Collections.Generic;
-using UnityEngine;
-namespace Blue
-{
-    public class UnSubscribeOnDisableTrigger : MonoBehaviour
-    {
-        private HashSet<IUnSubscribe> unSubscribes = new HashSet<IUnSubscribe>();
-
-        public void AddUnSubscribe(IUnSubscribe unSubscribe) 
-        {
-            unSubscribes.Add(unSubscribe);
-        }
-        private void OnDisable()
-        {
-            foreach (var item in unSubscribes)
-            {
-                item.UnSubscribe();
-            }
-            unSubscribes.Clear();
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/Event/UnSubscribeOnDisableTrigger.cs.meta

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

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

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

+ 0 - 236
Assets/Scripts/Blue/0.FrameworkDesign/IOC/AbstractArchitectureComponentInjector.cs

@@ -1,236 +0,0 @@
-using System;
-using System.Reflection;
-using System.Collections.Generic;
-
-namespace Blue
-{
-    public abstract class AbstractArchitectureComponentInjector : IArchitectureComponentInjector
-    {
-        private Type mComponentType;
-        private bool canInjectTypeListNotInitiated=true;
-        private List<Type> canInjectTypeList;
-        private Dictionary<Type, List<InjectInfo>> injectionMap;
-        protected IArchitecture architectureInstance;
-
-        public AbstractArchitectureComponentInjector(Type componentType)
-        {
-            SetComponentType(componentType);
-        }
-        public void SetArchitecture(IArchitecture architecture)
-        {
-            if (architectureInstance == null)
-            {
-                architectureInstance = architecture;
-            }
-        }
-        private void SetComponentType(Type componentType)
-        {
-            mComponentType = componentType;
-        }
-
-        public virtual void PrepairInjectionData(Type baseType)
-        {
-            if (canInjectTypeListNotInitiated)
-            {
-                canInjectTypeListNotInitiated = false;
-                injectionMap = new Dictionary<Type, List<InjectInfo>>();
-                canInjectTypeList = GetCanInjectTypeList(mComponentType);
-            }
-            FilterInjectInfoList(GetInjectInfo(baseType), mComponentType);
-        }
-        public virtual void Inject(IArchitecture architecture)
-        {
-            if (injectionMap == null)
-            {
-                return;
-            }
-            SetArchitecture(architecture);
-            int injectionCount = injectionMap.Count;
-            List<Type> types = new List<Type>(injectionCount);
-            types.AddRange(injectionMap.Keys);
-            if (injectionCount > 0)
-            {
-                for (int i = 0; i < injectionCount; i++)
-                {
-                    Type baseType = types[i];
-                    object injectObject = GetInjectObject(baseType);
-                    if (injectObject == null)
-                    {
-                        continue;
-                        //throw new Exception("Can not find instance of "+baseType.FullName+" ,please make sure you have registed it.");
-                    }
-                    if (!injectObject.GetType().Equals(baseType))
-                    {
-                        continue;//Not the registed Type
-                    }
-                    List<InjectInfo> typeInjectInfoList = injectionMap[baseType];
-                    foreach (InjectInfo injectInfo in typeInjectInfoList)
-                    {
-                        if (injectInfo.InjectScope == InjectScope.Prototype)
-                        {
-                            InjectPrototype(injectObject, injectInfo.InjectField, injectInfo.InjectType);
-                        }
-                        else
-                        {
-                            object injectInstance = GetInjectInstance(injectInfo.InjectType);
-                            InjectSingleton(injectObject, injectInfo.InjectField, injectInstance);
-                        }
-                    }
-                }
-            }
-        }
-        public void Dispose()
-        {
-            if (canInjectTypeList != null)
-            {
-                canInjectTypeList.Clear();
-                canInjectTypeList = null;
-            }
-            if (injectionMap != null)
-            {
-                injectionMap.Clear();
-                injectionMap = null;
-            }
-            mComponentType = null;
-            architectureInstance = null;
-        }
-        protected virtual object GetInjectObject(Type baseType)
-        {
-            return null;
-        }
-        protected virtual object GetInjectInstance(Type injectType)
-        {
-            if (TypeChecker.Instance.IsService(injectType))
-            {
-                return architectureInstance.GetService(injectType);
-            }
-            if (TypeChecker.Instance.IsModel(injectType))
-            {
-                return architectureInstance.GetModel(injectType);
-            }
-            if (TypeChecker.Instance.IsUtility(injectType))
-            {
-                return architectureInstance.GetUtility(injectType);
-            }
-            throw new Exception(injectType.FullName+" is not a can inject type!");
-        }
-        protected Dictionary<Type, List<InjectInfo>> GetInjectionMap()
-        {
-            return injectionMap;
-        }
-        protected void InjectSingleton(object injectObject, FieldInfo fieldInfo, object injectInstance)
-        {
-            fieldInfo.SetValue(injectObject, injectInstance);
-        }
-        protected void InjectPrototype(object injectObject, FieldInfo fieldInfo, Type injectType)
-        {
-            fieldInfo.SetValue(injectObject, Activator.CreateInstance(injectType));
-        }
-
-        private List<Type> GetCanInjectTypeList(Type baseType)
-        {
-            List<Type> canInjectTypeList = new List<Type>();
-            Type[] interfaceArr = baseType.GetInterfaces();
-            for (int i = 0; i < interfaceArr.Length; i++)
-            {
-                Type interfaceType = interfaceArr[i];
-                InjectRuleAttribute attribute = null;
-                if ((attribute = interfaceType.GetCustomAttribute<InjectRuleAttribute>()) != null)
-                {
-                    canInjectTypeList.AddRange(attribute.GetCanInjectList());
-                }
-            }
-            return canInjectTypeList;
-        }
-        private List<InjectInfo> GetInjectInfo(Type tmpType)
-        {
-            List<InjectInfo> injectInfoList = new List<InjectInfo>();
-            FieldInfo[] tmpFieldArr = tmpType.GetFields(BindingFlags.Instance | BindingFlags.NonPublic);
-            int length = 0;
-            if (tmpFieldArr != null)
-            {
-                length = tmpFieldArr.Length;
-            }
-            for (int i = 0; i < length; i++)
-            {
-                FieldInfo tmpField = tmpFieldArr[i];
-                AutoInjectAttribute autoInjectAttribute = tmpField.GetCustomAttribute<AutoInjectAttribute>();
-                if (autoInjectAttribute != null)
-                {
-                    InjectInfo injectInfo = new InjectInfo()
-                    {
-                        BaseType = tmpType,
-                        InjectField = tmpField,
-                        InjectScope = autoInjectAttribute.GetInjectScope()
-                    };
-                    if (autoInjectAttribute.GetInjectType() != null)
-                    {
-                        if (CheckType(tmpField.FieldType, autoInjectAttribute.GetInjectType()))
-                        {
-                            injectInfo.InjectType = autoInjectAttribute.GetInjectType();
-                        }
-                        else
-                        {
-                            throw new Exception("Can not finish the injection of:" + tmpType.FullName + ": property: " + tmpField.Name + ", please check the injectType!");
-                        }
-                    }
-                    else
-                    {
-                        injectInfo.InjectType = tmpField.FieldType;
-                    }
-                    injectInfoList.Add(injectInfo);
-                }
-            }
-            return injectInfoList;
-        }
-        //if the injectinfo not match the inject rule,than remove it from the injectInfoList
-        //for example,you can not  inject a IService instance in a IMolde implementation class 
-        private void FilterInjectInfoList(List<InjectInfo> injectInfoList, Type type)
-        {
-            int count = injectInfoList.Count;
-            for (int i = 0; i < count; i++)
-            {
-                InjectInfo injectInfo = injectInfoList[i];
-                if (CheckIfCanInject(canInjectTypeList, injectInfo.InjectType))
-                {
-                    if (injectionMap.ContainsKey(injectInfo.BaseType))
-                    {
-                        injectionMap[injectInfo.BaseType].Add(injectInfo);
-                    }
-                    else
-                    {
-                        List<InjectInfo> typeInjectInfoList = new List<InjectInfo>();
-                        typeInjectInfoList.Add(injectInfo);
-                        injectionMap.Add(injectInfo.BaseType, typeInjectInfoList);
-                    }
-                }
-            }
-        }
-        //check if the fieldType and injectType is mismatch;
-        private bool CheckType(Type fieldType, Type injectType)
-        {
-            if (injectType.Equals(fieldType))
-            {
-                return true;
-            }
-            if (fieldType.IsInterface)
-            {
-                return fieldType.IsAssignableFrom(injectType);
-            }
-            return injectType.IsSubclassOf(fieldType);
-        }
-        private bool CheckIfCanInject(List<Type> canInjectTypeList, Type injectType)
-        {
-            bool result = false;
-            foreach (var canInjectType in canInjectTypeList)
-            {
-                if (canInjectType.IsAssignableFrom(injectType))
-                {
-                    result = true;
-                    break;
-                }
-            }
-            return result;
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/IOC/AbstractArchitectureComponentInjector.cs.meta

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

+ 0 - 132
Assets/Scripts/Blue/0.FrameworkDesign/IOC/ArchitectureInjecter.cs

@@ -1,132 +0,0 @@
-using System.Diagnostics;
-using System.Linq.Expressions;
-using System;
-
-namespace Blue
-{
-    /// <summary>
-    /// Architecture注入类
-    /// 主要负责四层 Controller、Model、Service、Utility的分别注入
-    /// </summary>
-    public class ArchitectureInjecter:IInjector
-    {
-        private IArchitectureComponentInjector controllerInjector;
-        private IArchitectureComponentInjector serviceInjector;
-        private IArchitectureComponentInjector modelInjector;
-        private IArchitectureComponentInjector utilityInjector;
-
-        /// <summary>
-        /// ArchitectureInjecter初始化
-        /// 主要初始化四层 Controller、Model、Service、Utility的注入
-        /// </summary>
-        public ArchitectureInjecter()
-        {
-            controllerInjector = new ControllerInjector();
-            serviceInjector = new ServiceInjector();
-            modelInjector = new ModelInjector();
-            utilityInjector = new UtilityInjector();
-        }
-
-        public void PrepairInjectionData(Type processtype)
-        {
-            PrepairInjectionDataImpl(processtype);
-        }
-
-        /// <summary>
-        /// 根据传入的类型注入到指定的层注入
-        /// </summary>
-        /// <param name="baseType">传入的类型</param>
-        private void PrepairInjectionDataImpl(Type baseType)
-        {
-            if (!TypeChecker.Instance.IsCanInject(baseType))
-            {
-                return;
-            }
-
-            if (TypeChecker.Instance.IsController(baseType))
-            {
-                PrepairControllerInjectionData(baseType);
-            }
-            if (TypeChecker.Instance.IsService(baseType))
-            {
-                PrepairServiceInjectionData(baseType);
-            }
-            if (TypeChecker.Instance.IsModel(baseType))
-            {
-                PrepairModelInjectionData(baseType);
-            }
-            if (TypeChecker.Instance.IsUtility(baseType))
-            {
-                PrepairUtilityInjectionData(baseType);
-            }
-        }
-
-        /// <summary>
-        /// 设置 Architecture
-        /// Controller、Model、Service、Utility注入分别设置architecture
-        /// </summary>
-        public void Inject(IArchitecture architecture)
-        {
-            InjectImpl(architecture);
-        }
-
-        /// <summary>
-        /// 执行与释放或重置非托管资源相关的应用程序定义的任务
-        /// </summary>
-        public void Dispose()
-        {
-            controllerInjector.Dispose();
-            serviceInjector.Dispose();
-            modelInjector.Dispose();
-            utilityInjector.Dispose();
-            controllerInjector = null;
-            serviceInjector = null;
-            modelInjector = null;
-            utilityInjector = null;
-        }
-
-        /// <summary>
-        /// Controller、Model、Service、Utility注入设置architecture
-        /// </summary>
-        /// <param name="architecture"></param>
-        private void InjectImpl(IArchitecture architecture)
-        {
-            controllerInjector.Inject(architecture);
-            serviceInjector.Inject(architecture);
-            modelInjector.Inject(architecture);
-            utilityInjector.Inject(architecture);
-        }
-
-        /// <summary>
-        /// 预注入Controller数据
-        /// </summary>
-        private void PrepairControllerInjectionData(Type baseType)
-        {
-            controllerInjector.PrepairInjectionData(baseType);
-        }
-
-        /// <summary>
-        /// 预注入Model数据
-        /// </summary>
-        private void PrepairModelInjectionData(Type baseType)
-        {
-            modelInjector.PrepairInjectionData(baseType);
-        }
-
-        /// <summary>
-        /// 预注入Service数据
-        /// </summary>
-        private void PrepairServiceInjectionData(Type baseType)
-        {
-            serviceInjector.PrepairInjectionData(baseType);
-        }
-
-        /// <summary>
-        /// 预注入Utility数据
-        /// </summary>
-        private void PrepairUtilityInjectionData(Type baseType)
-        {
-            utilityInjector.PrepairInjectionData(baseType);
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/IOC/ArchitectureInjecter.cs.meta

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

+ 0 - 36
Assets/Scripts/Blue/0.FrameworkDesign/IOC/AutoInjectAttribute.cs

@@ -1,36 +0,0 @@
-using System;
-
-namespace Blue
-{
-    /// <summary>
-    /// 自动注入---可以对字段应用属性
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Field)]
-    public class AutoInjectAttribute : Attribute
-    {
-        private Type type;
-        private InjectScope scope;
-        public AutoInjectAttribute()
-        {
-            scope = InjectScope.Singleton;
-        }
-        public AutoInjectAttribute(Type injectType):base()
-        {
-            type = injectType;
-        }
-        public AutoInjectAttribute(Type injectType, InjectScope injectScope)
-        {
-            type = injectType;
-            scope = injectScope;
-        }
-        public Type GetInjectType()
-        {
-            return type;
-        }
-        public InjectScope GetInjectScope()
-        {
-            return scope;
-        }
-
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/IOC/AutoInjectAttribute.cs.meta

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

+ 0 - 54
Assets/Scripts/Blue/0.FrameworkDesign/IOC/ControllerInjector.cs

@@ -1,54 +0,0 @@
-using System;
-using System.Collections.Generic;
-using UnityEngine;
-namespace Blue
-{
-
-    public class ControllerInjector : AbstractArchitectureComponentInjector
-    {
-        public ControllerInjector():base(typeof(IController))
-        {
-        }
-        private  object[] GetInjectObjects(Type baseType)
-        {
-            return GameObject.FindObjectsOfType(baseType, true);
-        }
-        public override void Inject(IArchitecture architecture)
-        {
-            SetArchitecture(architecture);
-            Dictionary<Type, List<InjectInfo>> injectionMap = GetInjectionMap();
-            if (injectionMap == null)
-            {
-                return;
-            }
-            int injectionCount = injectionMap.Count;
-            var types = injectionMap.Keys;
-            if (injectionCount > 0)
-            {
-                foreach (Type baseType in types)
-                {
-                    object[] injectObjects = GetInjectObjects(baseType);
-                    List<InjectInfo> typeInjectInfoList = injectionMap[baseType];
-                    foreach (InjectInfo injectInfo in typeInjectInfoList)
-                    {
-                        if (injectInfo.InjectScope == InjectScope.Prototype)
-                        {
-                            for (int i = 0; i < injectObjects.Length; i++)
-                            {
-                                InjectPrototype(injectObjects[i], injectInfo.InjectField, injectInfo.InjectType);
-                            }
-                        }
-                        else
-                        {
-                            object injectInstance = GetInjectInstance(injectInfo.InjectType);
-                            for (int i = 0; i < injectObjects.Length; i++)
-                            {
-                                InjectSingleton(injectObjects[i], injectInfo.InjectField, injectInstance);
-                            }
-                        }
-                    }
-                }
-            }
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/IOC/ControllerInjector.cs.meta

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

+ 0 - 19
Assets/Scripts/Blue/0.FrameworkDesign/IOC/IArchitectureComponentInjector.cs

@@ -1,19 +0,0 @@
-using System;
-namespace Blue
-{
-    /// <summary>
-    /// 实现Architecture组件注入的接口
-    /// </summary>
-    public interface IArchitectureComponentInjector:IDisposable
-    {
-        /// <summary>
-        /// 根据类型预注入数据
-        /// </summary>
-        void PrepairInjectionData(Type baseType);
-
-        /// <summary>
-        /// architecture注入
-        /// </summary>
-        void Inject(IArchitecture architecture);
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/IOC/IArchitectureComponentInjector.cs.meta

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

+ 0 - 19
Assets/Scripts/Blue/0.FrameworkDesign/IOC/IInjector.cs

@@ -1,19 +0,0 @@
-using System;
-namespace Blue
-{
-    /// <summary>
-    /// 实现注入功能的接口
-    /// </summary>
-    public interface IInjector:IDisposable
-    {
-        /// <summary>
-        /// 根据类型预注入数据
-        /// </summary>
-        void PrepairInjectionData(Type processType);
-
-        /// <summary>
-        /// architectureInstance注入
-        /// </summary>
-        void Inject(IArchitecture architectureInstance);
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/IOC/IInjector.cs.meta

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

+ 0 - 65
Assets/Scripts/Blue/0.FrameworkDesign/IOC/IOCContainer.cs

@@ -1,65 +0,0 @@
-using System.Collections.Generic;
-using System;
-
-namespace Blue
-{
-    /// <summary>
-    /// IOC容器---根据类型存储Object
-    /// </summary>
-    public class IOCContainer
-    {
-        private Dictionary<Type, object> container = new Dictionary<Type, object>();
-
-        /// <summary>
-        /// 将实例注入IOC容器
-        /// </summary>
-        public void Register<T>() where T:new()
-        {
-            Register(new T());
-        }
-
-        /// <summary>
-        /// 将实例注入IOC容器
-        /// </summary>
-        public void Register<T>(T instance)
-        {
-            Type t = typeof(T);
-            if (container.ContainsKey(t))
-            {
-                container[t] = instance;
-            }
-            else
-            {
-                container.Add(t,instance);
-            }
-        }
-
-        /// <summary>
-        /// 根据类型从IOC容器获取对象
-        /// </summary>
-        public object Get(Type type)
-        {
-            if (container.TryGetValue(type,out object instance))
-            {
-                return instance;
-            }
-            return default;
-        }
-
-        /// <summary>
-        /// 从IOC容器获取指定的实例
-        /// </summary>
-        public T Get<T>()
-        {
-            Type t = typeof(T);
-            if (container.TryGetValue(t, out object instance))
-            {
-                return (T)instance;
-            }
-            else
-            {
-                throw new Exception("Can Not Find Instance of type "+t.FullName+",Please Call Register At First!");
-            }
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/IOC/IOCContainer.cs.meta

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

+ 0 - 13
Assets/Scripts/Blue/0.FrameworkDesign/IOC/InjectInfo.cs

@@ -1,13 +0,0 @@
-using System;
-using System.Reflection;
-
-namespace Blue
-{
-    public class InjectInfo
-    {
-        public Type BaseType { get; set; }
-        public FieldInfo InjectField { get; set; }
-        public Type InjectType { get; set; }
-        public InjectScope InjectScope { get; set; }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/IOC/InjectInfo.cs.meta

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

+ 0 - 40
Assets/Scripts/Blue/0.FrameworkDesign/IOC/InjectRuleAttribute.cs

@@ -1,40 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Blue
-{
-    /// <summary>
-    /// 注入规则属性---可以对接口应用属性
-    /// </summary>
-    [AttributeUsage(AttributeTargets.Interface)]
-    public class InjectRuleAttribute : Attribute
-    {
-        private List<Type> canInjectList;
-        private Type baseInjectType;
-        public InjectRuleAttribute(params Type[] canInject)
-        {
-            baseInjectType = typeof(ICanInject);
-            canInjectList = new List<Type>(canInject.Length);
-            foreach (var item in canInject)
-            {
-                if (item.GetInterfaces().Contains(baseInjectType))
-                {
-                    canInjectList.Add(item);
-                }
-            }
-        }
-        public List<Type> GetCanInjectList()
-        {
-            return canInjectList;
-        }
-        public bool IfCanInject(Type canInject)
-        {
-            if (canInjectList.Contains(canInject))
-            {
-                return true;
-            }
-            return false;
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/IOC/InjectRuleAttribute.cs.meta

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

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/IOC/InjectScope.cs

@@ -1,11 +0,0 @@
-namespace Blue
-{
-    /// <summary>
-    /// 注入范围
-    /// </summary>
-    public enum InjectScope
-    {
-        Singleton,
-        Prototype
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/IOC/InjectScope.cs.meta

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

+ 0 - 43
Assets/Scripts/Blue/0.FrameworkDesign/IOC/ModelInjector.cs

@@ -1,43 +0,0 @@
-using System;
-
-namespace Blue
-{
-    /// <summary>
-    /// Model 层注入
-    /// </summary>
-    public class ModelInjector : AbstractArchitectureComponentInjector
-    {
-        private Type modelType;
-
-        /// <summary>
-        /// 获取 IModel 的类型
-        /// </summary>
-        public ModelInjector() : base(typeof(IModel)) {
-            modelType = typeof(IModel);
-        }
-
-        /// <summary>
-        /// 根据类型获取注入的Object
-        /// </summary>
-        protected override object GetInjectObject(Type baseType)
-        {
-            object instance = architectureInstance.GetModel(baseType);
-            if (instance == null)
-            {
-                var interfaces = baseType.GetInterfaces(); // 当在派生类中重写时,获取由当前 Type 实现或继承的所有接口
-                foreach (var type in interfaces)
-                {
-                    if (modelType.IsAssignableFrom(type)&&!modelType.Equals(type)) // 确定指定类型 type 的实例是否能分配给当前类型的变量
-                    {
-                        instance = architectureInstance.GetModel(type);
-                        if (instance != null)
-                        {
-                            break;
-                        }
-                    }
-                }
-            }
-            return instance;
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/IOC/ModelInjector.cs.meta

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

+ 0 - 43
Assets/Scripts/Blue/0.FrameworkDesign/IOC/ServiceInjector.cs

@@ -1,43 +0,0 @@
-using System;
-namespace Blue
-{
-    /// <summary>
-    /// Service 层注入
-    /// </summary>
-    public class ServiceInjector : AbstractArchitectureComponentInjector
-    {
-        private Type serviceType;
-
-        /// <summary>
-        /// 获取 IService 的类型
-        /// </summary>
-        public ServiceInjector():base(typeof(IService)) {
-            serviceType = typeof(IService);
-        }
-
-        /// <summary>
-        /// 根据类型获取注入的Object
-        /// </summary>
-        protected override object GetInjectObject(Type baseType)
-        {
-            object instance= architectureInstance.GetService(baseType);
-            if (instance == null)
-            {
-                var interfaces = baseType.GetInterfaces();
-
-                foreach (var type in interfaces)
-                {
-                    if (serviceType.IsAssignableFrom(type)&&!serviceType.Equals(type))
-                    {
-                        instance = architectureInstance.GetService(type);
-                        if (instance != null)
-                        {
-                            break;
-                        }
-                    }
-                }
-            }
-            return instance;
-        }
-    }
-}

+ 0 - 11
Assets/Scripts/Blue/0.FrameworkDesign/IOC/ServiceInjector.cs.meta

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

+ 0 - 79
Assets/Scripts/Blue/0.FrameworkDesign/IOC/TypeChecker.cs

@@ -1,79 +0,0 @@
-using System;
-using UnityEngine.Scripting;
-
-namespace Blue
-{
-    /// <summary>
-    /// 类型检查 --- Preserve属性
-    /// 防止字节码剥离移除类、方法、字段或属性
-    /// </summary>
-    [Preserve]
-    public class TypeChecker:Singleton<TypeChecker>
-    {
-        private Type canInjectBaseType;
-        private Type controllerType;
-        private Type modelType;
-        private Type serviceType;
-        private Type utilityType;
-       // [RequiredMember]
-        private TypeChecker()
-        {
-            canInjectBaseType = typeof(ICanInject);
-            controllerType = typeof(IController);
-            modelType = typeof(IModel);
-            serviceType = typeof(IService);
-            utilityType = typeof(IUtility);
-        }
-
-        /// <summary>
-        /// 传入的类型是否来自ICanInject类型
-        /// </summary>
-        /// <param name="type">传入的类型</param>
-        public bool IsCanInject(Type type)
-        {
-            /*
-            TypeA.IsAssignableFrom
-            如果TypeA和TypeB类型一样则返回true
-            如果TypeA是TypeB的父类则返回true;
-            如果TypeB实现了接口TypeA则返回true;
-            */
-            return canInjectBaseType.IsAssignableFrom(type); // 确定指定类型 type 的实例是否能分配给当前类型的变量
-        }
-
-        /// <summary>
-        /// 传入的类型是否来自IController类型
-        /// </summary>
-        /// <param name="type">传入的类型</param>
-        public bool IsController(Type type)
-        {
-            return controllerType.IsAssignableFrom(type);
-        }
-
-        /// <summary>
-        /// 传入的类型是否来自IModel类型
-        /// </summary>
-        /// <param name="type">传入的类型</param>
-        public bool IsModel(Type type)
-        {
-            return modelType.IsAssignableFrom(type);
-        }
-
-        /// <summary>
-        /// 传入的类型是否来自IService类型
-        /// </summary>
-        /// <param name="type">传入的类型</param>
-        public bool IsService(Type type)
-        {
-            return serviceType.IsAssignableFrom(type);
-        }
-
-        /// <summary>
-        /// 传入的类型是否来自IUtility类型
-        /// </summary>
-        /// <param name="type">传入的类型</param>
-        public bool IsUtility(Type type)
-        {
-            return utilityType.IsAssignableFrom(type);
-        }
-    }
-}

Some files were not shown because too many files changed in this diff