Explorar el Código

GetComponent(Type type)也需要加上GetComponentSystem

tanghai hace 4 años
padre
commit
92d8370dab
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      Unity/Codes/Model/Core/Object/Entity.cs

+ 6 - 0
Unity/Codes/Model/Core/Object/Entity.cs

@@ -679,6 +679,12 @@ namespace ET
             {
                 return null;
             }
+            
+            // 如果有IGetComponent接口,则触发GetComponentSystem
+            if (component is IGetComponent)
+            {
+                EventSystem.Instance.GetComponent(component);
+            }
 
             return component;
         }