Browse Source

去掉IsCreated,跟IsNew重复

tanghai 1 year ago
parent
commit
5f8a7b837e

+ 4 - 23
Unity/Assets/Scripts/Core/Entity/Entity.cs

@@ -13,9 +13,8 @@ namespace ET
         IsFromPool = 1,
         IsRegister = 1 << 1,
         IsComponent = 1 << 2,
-        IsCreated = 1 << 3,
-        IsNew = 1 << 4,
-        IsSerilizeWithParent = 1 << 5,
+        IsNew = 1 << 3,
+        IsSerilizeWithParent = 1 << 4,
     }
 
     [MemoryPackable(GenerateType.NoGenerate)]
@@ -133,23 +132,6 @@ namespace ET
             }
         }
 
-        [BsonIgnore]
-        protected bool IsCreated
-        {
-            get => (this.status & EntityStatus.IsCreated) == EntityStatus.IsCreated;
-            set
-            {
-                if (value)
-                {
-                    this.status |= EntityStatus.IsCreated;
-                }
-                else
-                {
-                    this.status &= ~EntityStatus.IsCreated;
-                }
-            }
-        }
-
         [BsonIgnore]
         protected bool IsNew
         {
@@ -392,9 +374,9 @@ namespace ET
                     }
                 }
 
-                if (!this.IsCreated)
+                if (!this.IsNew)
                 {
-                    this.IsCreated = true;
+                    this.IsNew = true;
                     EntitySystemSingleton.Instance.Deserialize(this);
                 }
             }
@@ -718,7 +700,6 @@ namespace ET
             }
 
             component.IsFromPool = isFromPool;
-            component.IsCreated = true;
             component.IsNew = true;
             component.Id = 0;
             return component;

+ 0 - 1
Unity/Assets/Scripts/Core/Entity/Scene.cs

@@ -28,7 +28,6 @@ namespace ET
             this.Name = name;
             this.InstanceId = instanceId;
             this.SceneType = sceneType;
-            this.IsCreated = true;
             this.IsNew = true;
             this.Fiber = fiber;
             this.IScene = this;