|
@@ -1,6 +1,5 @@
|
|
|
using System;
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
|
-using System.Runtime.Serialization;
|
|
|
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
|
|
|
|
|
|
namespace ET
|
|
namespace ET
|
|
@@ -22,7 +21,6 @@ namespace ET
|
|
|
private UnityEngine.GameObject viewGO;
|
|
private UnityEngine.GameObject viewGO;
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
public long InstanceId
|
|
public long InstanceId
|
|
|
{
|
|
{
|
|
@@ -34,11 +32,9 @@ namespace ET
|
|
|
{
|
|
{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
private EntityStatus status = EntityStatus.None;
|
|
private EntityStatus status = EntityStatus.None;
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
private bool IsFromPool
|
|
private bool IsFromPool
|
|
|
{
|
|
{
|
|
@@ -56,7 +52,6 @@ namespace ET
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
protected bool IsRegister
|
|
protected bool IsRegister
|
|
|
{
|
|
{
|
|
@@ -103,7 +98,6 @@ namespace ET
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
private bool IsComponent
|
|
private bool IsComponent
|
|
|
{
|
|
{
|
|
@@ -121,7 +115,6 @@ namespace ET
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
protected bool IsCreated
|
|
protected bool IsCreated
|
|
|
{
|
|
{
|
|
@@ -139,7 +132,6 @@ namespace ET
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
protected bool IsNew
|
|
protected bool IsNew
|
|
|
{
|
|
{
|
|
@@ -157,16 +149,13 @@ namespace ET
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
public bool IsDisposed => this.InstanceId == 0;
|
|
public bool IsDisposed => this.InstanceId == 0;
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
protected Entity parent;
|
|
protected Entity parent;
|
|
|
|
|
|
|
|
// 可以改变parent,但是不能设置为null
|
|
// 可以改变parent,但是不能设置为null
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
public Entity Parent
|
|
public Entity Parent
|
|
|
{
|
|
{
|
|
@@ -207,7 +196,6 @@ namespace ET
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
// 该方法只能在AddComponent中调用,其他人不允许调用
|
|
// 该方法只能在AddComponent中调用,其他人不允许调用
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
private Entity ComponentParent
|
|
private Entity ComponentParent
|
|
@@ -263,11 +251,9 @@ namespace ET
|
|
|
set;
|
|
set;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
protected Entity domain;
|
|
protected Entity domain;
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
public Entity Domain
|
|
public Entity Domain
|
|
|
{
|
|
{
|
|
@@ -342,16 +328,13 @@ namespace ET
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonElement("Children")]
|
|
[BsonElement("Children")]
|
|
|
[BsonIgnoreIfNull]
|
|
[BsonIgnoreIfNull]
|
|
|
private HashSet<Entity> childrenDB;
|
|
private HashSet<Entity> childrenDB;
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
private Dictionary<long, Entity> children;
|
|
private Dictionary<long, Entity> children;
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
public Dictionary<long, Entity> Children
|
|
public Dictionary<long, Entity> Children
|
|
|
{
|
|
{
|
|
@@ -422,16 +405,13 @@ namespace ET
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonElement("C")]
|
|
[BsonElement("C")]
|
|
|
[BsonIgnoreIfNull]
|
|
[BsonIgnoreIfNull]
|
|
|
private HashSet<Entity> componentsDB;
|
|
private HashSet<Entity> componentsDB;
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
private Dictionary<Type, Entity> components;
|
|
private Dictionary<Type, Entity> components;
|
|
|
|
|
|
|
|
- [IgnoreDataMember]
|
|
|
|
|
[BsonIgnore]
|
|
[BsonIgnore]
|
|
|
public Dictionary<Type, Entity> Components
|
|
public Dictionary<Type, Entity> Components
|
|
|
{
|
|
{
|