|
@@ -82,10 +82,9 @@ namespace ET
|
|
|
[StaticField]
|
|
[StaticField]
|
|
|
private static readonly JsonWriterSettings defaultSettings = new() { OutputMode = JsonOutputMode.RelaxedExtendedJson };
|
|
private static readonly JsonWriterSettings defaultSettings = new() { OutputMode = JsonOutputMode.RelaxedExtendedJson };
|
|
|
|
|
|
|
|
- static MongoHelper()
|
|
|
|
|
|
|
+ public static void Register()
|
|
|
{
|
|
{
|
|
|
// 自动注册IgnoreExtraElements
|
|
// 自动注册IgnoreExtraElements
|
|
|
-
|
|
|
|
|
ConventionPack conventionPack = new ConventionPack { new IgnoreExtraElementsConvention(true) };
|
|
ConventionPack conventionPack = new ConventionPack { new IgnoreExtraElementsConvention(true) };
|
|
|
|
|
|
|
|
ConventionRegistry.Register("IgnoreExtraElements", conventionPack, type => true);
|
|
ConventionRegistry.Register("IgnoreExtraElements", conventionPack, type => true);
|
|
@@ -100,7 +99,6 @@ namespace ET
|
|
|
RegisterStruct<TSVector2>();
|
|
RegisterStruct<TSVector2>();
|
|
|
RegisterStruct<TSVector4>();
|
|
RegisterStruct<TSVector4>();
|
|
|
RegisterStruct<TSQuaternion>();
|
|
RegisterStruct<TSQuaternion>();
|
|
|
- RegisterStruct<LSInput>();
|
|
|
|
|
|
|
|
|
|
Dictionary<string, Type> types = EventSystem.Instance.GetTypes();
|
|
Dictionary<string, Type> types = EventSystem.Instance.GetTypes();
|
|
|
foreach (Type type in types.Values)
|
|
foreach (Type type in types.Values)
|
|
@@ -119,10 +117,6 @@ namespace ET
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static void Init()
|
|
|
|
|
- {
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
public static void RegisterStruct<T>() where T : struct
|
|
public static void RegisterStruct<T>() where T : struct
|
|
|
{
|
|
{
|
|
|
BsonSerializer.RegisterSerializer(typeof (T), new StructBsonSerialize<T>());
|
|
BsonSerializer.RegisterSerializer(typeof (T), new StructBsonSerialize<T>());
|