Просмотр исходного кода

GetComponent(Type type)也需要加上GetComponentSystem

tanghai 4 лет назад
Родитель
Сommit
92d8370dab
1 измененных файлов с 6 добавлено и 0 удалено
  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;
         }