Просмотр исходного кода

服务端命令行编辑器添加回来

tanghai 8 лет назад
Родитель
Сommit
5d76be8dde

+ 0 - 9
Unity/Assets/Editor/ServerCommandLineEditor/Config.meta

@@ -1,9 +0,0 @@
-fileFormatVersion: 2
-guid: c889e797522809d4c8c38545b4134aca
-folderAsset: yes
-timeCreated: 1498814020
-licenseType: Free
-DefaultImporter:
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 7 - 1
Unity/Assets/Scripts/Config/AConfigComponent.cs

@@ -1,8 +1,14 @@
-namespace Model
+using MongoDB.Bson.Serialization.Attributes;
+
+namespace Model
 {
 	/// <summary>
 	/// 每个Config的基类
 	/// </summary>
+	[BsonKnownTypes(typeof(ClientConfig))]
+	[BsonKnownTypes(typeof(InnerConfig))]
+	[BsonKnownTypes(typeof(OuterConfig))]
+	[BsonKnownTypes(typeof(RunServerConfig))]
 	public abstract class AConfigComponent: Component
 	{
 	}

+ 2 - 2
Unity/Assets/Scripts/Config/AConfigComponent.cs.meta

@@ -1,7 +1,7 @@
 fileFormatVersion: 2
 guid: 3a286d83056068f4ba8dfcf7a37b926d
-timeCreated: 1478145676
-licenseType: Pro
+timeCreated: 1498879455
+licenseType: Free
 MonoImporter:
   serializedVersion: 2
   defaultReferences: []

+ 4 - 1
Unity/Assets/Editor/ServerCommandLineEditor/Config/ClientConfig.cs → Unity/Assets/Scripts/Entity/Config/ClientConfig.cs

@@ -1,10 +1,13 @@
-namespace Model
+using MongoDB.Bson.Serialization.Attributes;
+
+namespace Model
 {
 	public class ClientConfig: AConfigComponent
 	{
 		public string Host = "";
 		public int Port;
 		
+		[BsonIgnore]
 		public string Address
 		{
 			get

+ 2 - 2
Unity/Assets/Editor/ServerCommandLineEditor/Config/ClientConfig.cs.meta → Unity/Assets/Scripts/Entity/Config/ClientConfig.cs.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: befeb8cfbdbfc5b4ea5f967c200d4751
-timeCreated: 1498118076
+guid: 55a8e5c4f18085e478c48b724a130a3f
+timeCreated: 1498879500
 licenseType: Free
 MonoImporter:
   serializedVersion: 2

+ 0 - 0
Unity/Assets/Editor/ServerCommandLineEditor/Config/InnerConfig.cs → Unity/Assets/Scripts/Entity/Config/InnerConfig.cs


+ 2 - 2
Unity/Assets/Editor/ServerCommandLineEditor/Config/InnerConfig.cs.meta → Unity/Assets/Scripts/Entity/Config/InnerConfig.cs.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 35f166fd86ee5e44aaec9326bb0a5454
-timeCreated: 1498118076
+guid: 4064ddb40060cc1428752c3e0801d9c8
+timeCreated: 1498879500
 licenseType: Free
 MonoImporter:
   serializedVersion: 2

+ 0 - 0
Unity/Assets/Editor/ServerCommandLineEditor/Config/OuterConfig.cs → Unity/Assets/Scripts/Entity/Config/OuterConfig.cs


+ 2 - 2
Unity/Assets/Editor/ServerCommandLineEditor/Config/OuterConfig.cs.meta → Unity/Assets/Scripts/Entity/Config/OuterConfig.cs.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: 31224cfdac2f28c42bd641d5a2e80fe8
-timeCreated: 1498118075
+guid: 40de537c2dfc44a439eab4fb74502abe
+timeCreated: 1498879500
 licenseType: Free
 MonoImporter:
   serializedVersion: 2

+ 0 - 0
Unity/Assets/Editor/ServerCommandLineEditor/Config/RunServerConfig.cs → Unity/Assets/Scripts/Entity/Config/RunServerConfig.cs


+ 2 - 2
Unity/Assets/Editor/ServerCommandLineEditor/Config/RunServerConfig.cs.meta → Unity/Assets/Scripts/Entity/Config/RunServerConfig.cs.meta

@@ -1,6 +1,6 @@
 fileFormatVersion: 2
-guid: bceb49362f439a248b806059721da628
-timeCreated: 1498118076
+guid: 9ae51a9486e2bc54580bb6ad0e16c28e
+timeCreated: 1498879500
 licenseType: Free
 MonoImporter:
   serializedVersion: 2

+ 2 - 1
Unity/Assets/Scripts/Object/Component.cs

@@ -2,6 +2,7 @@
 
 namespace Model
 {
+	[BsonKnownTypes(typeof(AConfigComponent))]
 	public abstract class Component: Disposer
 	{
 		[BsonIgnore]
@@ -34,7 +35,7 @@ namespace Model
 
 			base.Dispose();
 
-			this.Owner.RemoveComponent(this.GetType());
+			this.Owner?.RemoveComponent(this.GetType());
 		}
 	}
 }

+ 1 - 0
Unity/Assets/Scripts/Object/Entity.cs

@@ -9,6 +9,7 @@ namespace Model
 	{
 		public EntityType Type { get; set; }
 		
+		[BsonElement]
 		private HashSet<Component> components = new HashSet<Component>();
 		
 		[BsonIgnore]

+ 0 - 4
Unity/Unity.Editor.csproj

@@ -181,10 +181,6 @@
     <Compile Include="Assets\Editor\ReferenceCollectorEditor\ReferenceCollectorEditor.cs" />
     <Compile Include="Assets\Editor\RsyncEditor\RsyncConfig.cs" />
     <Compile Include="Assets\Editor\RsyncEditor\RsyncEditor.cs" />
-    <Compile Include="Assets\Editor\ServerCommandLineEditor\Config\ClientConfig.cs" />
-    <Compile Include="Assets\Editor\ServerCommandLineEditor\Config\InnerConfig.cs" />
-    <Compile Include="Assets\Editor\ServerCommandLineEditor\Config\OuterConfig.cs" />
-    <Compile Include="Assets\Editor\ServerCommandLineEditor\Config\RunServerConfig.cs" />
     <Compile Include="Assets\Editor\ServerCommandLineEditor\ServerCommandLineEditor.cs" />
     <Compile Include="Assets\PSD2UGUI\Editor\Const\PSDImporterConst.cs" />
     <Compile Include="Assets\PSD2UGUI\Editor\Core\PSDImportCtrl.cs" />

+ 11 - 4
Unity/Unity.csproj

@@ -12,12 +12,15 @@
     <ProjectTypeGuids>{E097FAD1-6243-4DAD-9C02-E9B9EFC3FFC1};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
     <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
     <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
-    <TargetFrameworkProfile></TargetFrameworkProfile>
-    <CompilerResponseFile></CompilerResponseFile>
+    <TargetFrameworkProfile>
+    </TargetFrameworkProfile>
+    <CompilerResponseFile>
+    </CompilerResponseFile>
     <UnityProjectType>Game:1</UnityProjectType>
     <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
     <UnityVersion>2017.1.0f1</UnityVersion>
-    <RootNamespace></RootNamespace>
+    <RootNamespace>
+    </RootNamespace>
     <LangVersion>6</LangVersion>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -451,6 +454,10 @@
     <Compile Include="Assets\Scripts\DllHelper.cs" />
     <Compile Include="Assets\Scripts\Entity\AssetBundleLoaderAsync.cs" />
     <Compile Include="Assets\Scripts\Entity\Config\BuffConfig.cs" />
+    <Compile Include="Assets\Scripts\Entity\Config\ClientConfig.cs" />
+    <Compile Include="Assets\Scripts\Entity\Config\InnerConfig.cs" />
+    <Compile Include="Assets\Scripts\Entity\Config\OuterConfig.cs" />
+    <Compile Include="Assets\Scripts\Entity\Config\RunServerConfig.cs" />
     <Compile Include="Assets\Scripts\Entity\Config\StartConfig.cs" />
     <Compile Include="Assets\Scripts\Entity\Game.cs" />
     <Compile Include="Assets\Scripts\Entity\Message\InnerMessage.cs" />
@@ -519,4 +526,4 @@
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />
-</Project>
+</Project>