فهرست منبع

如果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;