Преглед изворни кода

GetComponentSystem的函数跟GetComponent冲突,换个名字

tanghai пре 2 година
родитељ
комит
5c67d6e04f

+ 2 - 2
Unity/Assets/Scripts/Core/Entity/Entity.cs

@@ -655,7 +655,7 @@ namespace ET
             // 如果有IGetComponent接口,则触发GetComponentSystem
             // 如果有IGetComponent接口,则触发GetComponentSystem
             if (this is IGetComponent)
             if (this is IGetComponent)
             {
             {
-                EntitySystemSingleton.Instance.GetComponent(this, typeof(K));
+                EntitySystemSingleton.Instance.GetComponentSys(this, typeof(K));
             }
             }
             
             
             Entity component;
             Entity component;
@@ -678,7 +678,7 @@ namespace ET
             // 这个要在tryget之前调用,因为有可能components没有,但是执行GetComponentSystem后又有了
             // 这个要在tryget之前调用,因为有可能components没有,但是执行GetComponentSystem后又有了
             if (this is IGetComponent)
             if (this is IGetComponent)
             {
             {
-                EntitySystemSingleton.Instance.GetComponent(this, type);
+                EntitySystemSingleton.Instance.GetComponentSys(this, type);
             }
             }
             
             
             Entity component;
             Entity component;

+ 1 - 1
Unity/Assets/Scripts/Core/Entity/EntitySystemSingleton.cs

@@ -92,7 +92,7 @@ namespace ET
         }
         }
         
         
         // GetComponentSystem
         // GetComponentSystem
-        public void GetComponent(Entity entity, Type type)
+        public void GetComponentSys(Entity entity, Type type)
         {
         {
             List<object> iGetSystem = this.TypeSystems.GetSystems(entity.GetType(), typeof (IGetComponentSystem));
             List<object> iGetSystem = this.TypeSystems.GetSystems(entity.GetType(), typeof (IGetComponentSystem));
             if (iGetSystem == null)
             if (iGetSystem == null)

+ 2 - 2
Unity/Assets/Scripts/Core/Entity/IGetComponentSystem.cs

@@ -20,7 +20,7 @@ namespace ET
 	{
 	{
 		void IGetComponentSystem.Run(Entity o, Type type)
 		void IGetComponentSystem.Run(Entity o, Type type)
 		{
 		{
-			this.GetComponent((T)o, type);
+			this.GetComponentSys((T)o, type);
 		}
 		}
 
 
 		Type ISystemType.SystemType()
 		Type ISystemType.SystemType()
@@ -38,6 +38,6 @@ namespace ET
 			return typeof(T);
 			return typeof(T);
 		}
 		}
 
 
-		protected abstract void GetComponent(T self, Type type);
+		protected abstract void GetComponentSys(T self, Type type);
 	}
 	}
 }
 }