瀏覽代碼

继承结构调整要调整BsonKownType标签

tanghai 7 年之前
父節點
當前提交
8680735fab

+ 1 - 1
Server/Model/Base/Object/ComponentAttribute.cs

@@ -5,7 +5,7 @@ namespace ETModel
 	[BsonKnownTypes(typeof(AConfigComponent))]
 	[BsonKnownTypes(typeof(UnitGateComponent))]
 	[BsonKnownTypes(typeof(NumericComponent))]
-	[BsonKnownTypes(typeof(Entity))]
+	[BsonKnownTypes(typeof(ComponentWithId))]
 	public partial class Component
 	{
 	}

+ 9 - 0
Server/Model/Base/Object/ComponentWithIdAttribute.cs

@@ -0,0 +1,9 @@
+using MongoDB.Bson.Serialization.Attributes;
+
+namespace ETModel
+{
+	[BsonKnownTypes(typeof(Entity))]
+	public partial class ComponentWithId
+	{
+	}
+}

+ 1 - 1
Unity/Assets/Scripts/Base/Object/ComponentAttribute.cs

@@ -3,7 +3,7 @@
 namespace ETModel
 {
 	[BsonKnownTypes(typeof(AConfigComponent))]
-	[BsonKnownTypes(typeof(Entity))]
+	[BsonKnownTypes(typeof(ComponentWithId))]
 	public partial class Component
 	{
 	}

+ 9 - 0
Unity/Assets/Scripts/Base/Object/ComponentWithIdAttribute.cs

@@ -0,0 +1,9 @@
+using MongoDB.Bson.Serialization.Attributes;
+
+namespace ETModel
+{
+	[BsonKnownTypes(typeof(Entity))]
+	public partial class ComponentWithId
+	{
+	}
+}

+ 12 - 0
Unity/Assets/Scripts/Base/Object/ComponentWithIdAttribute.cs.meta

@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 580a3c3b48fdd5b438d5e185e407db41
+timeCreated: 1521513816
+licenseType: Free
+MonoImporter:
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 0
Unity/Unity.csproj

@@ -156,6 +156,7 @@
     <Compile Include="Assets\Scripts\Base\Math\VLine.cs" />
     <Compile Include="Assets\Scripts\Base\Math\VRect.cs" />
     <Compile Include="Assets\Scripts\Base\MultiMap.cs" />
+    <Compile Include="Assets\Scripts\Base\Object\ComponentWithIdAttribute.cs" />
     <Compile Include="Assets\Scripts\Base\Object\ComponentWithId.cs" />
     <Compile Include="Assets\Scripts\Base\Object\Component.cs" />
     <Compile Include="Assets\Scripts\Base\Object\ComponentAttribute.cs" />