Browse Source

GetComponent(Type type)也需要加上GetComponentSystem

tanghai 4 years ago
parent
commit
92d8370dab
1 changed files with 6 additions and 0 deletions
  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;
                 return null;
             }
             }
+            
+            // 如果有IGetComponent接口,则触发GetComponentSystem
+            if (component is IGetComponent)
+            {
+                EventSystem.Instance.GetComponent(component);
+            }
 
 
             return component;
             return component;
         }
         }