Explorar o código

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

tanghai hai 1 ano
pai
achega
9d4d4edb92
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  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;