Przeglądaj źródła

如果Entity没有挂到树上,不用执行SerializeSystem

tanghai 1 rok temu
rodzic
commit
9d4d4edb92
1 zmienionych plików z 6 dodań i 0 usunięć
  1. 6 0
      Unity/Assets/Scripts/Core/Entity/Entity.cs

+ 6 - 0
Unity/Assets/Scripts/Core/Entity/Entity.cs

@@ -871,6 +871,12 @@ namespace ET
 
         public override void BeginInit()
         {
+            // 如果没有挂到树上,不用执行SerializeSystem
+            if (this.iScene == null)
+            {
+                return;
+            }
+            
             if (this is not ISerializeToEntity && !this.IsSerilizeWithParent)
             {
                 return;