Ver Fonte

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

tanghai há 2 anos atrás
pai
commit
5c67d6e04f

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

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

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

@@ -92,7 +92,7 @@ namespace ET
         }
         
         // 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));
             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)
 		{
-			this.GetComponent((T)o, type);
+			this.GetComponentSys((T)o, type);
 		}
 
 		Type ISystemType.SystemType()
@@ -38,6 +38,6 @@ namespace ET
 			return typeof(T);
 		}
 
-		protected abstract void GetComponent(T self, Type type);
+		protected abstract void GetComponentSys(T self, Type type);
 	}
 }