Преглед изворни кода

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

tanghai пре 1 година
родитељ
комит
9d4d4edb92
1 измењених фајлова са 6 додато и 0 уклоњено
  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;