Kaynağa Gözat

打包平台默认为None,防止点错

tanghai 7 yıl önce
ebeveyn
işleme
e68dcf3d6b

+ 7 - 0
Unity/Assets/Editor/BuildEditor/BuildEditor.cs

@@ -15,9 +15,11 @@ namespace MyEditor
 
 	public enum PlatformType
 	{
+		None,
 		Android,
 		IOS,
 		PC,
+		WebGL,
 	}
 
 	public class BuildEditor : EditorWindow
@@ -49,6 +51,11 @@ namespace MyEditor
 
 			if (GUILayout.Button("开始打包"))
 			{
+				if (this.platformType == PlatformType.None)
+				{
+					Log.Error("请选择打包平台!");
+					return;
+				}
 				BuildHelper.Build(this.platformType, this.buildAssetBundleOptions, this.buildOptions, this.isBuildExe);
 			}
 		}

+ 3 - 0
Unity/Assets/Editor/BuildEditor/BuildHelper.cs

@@ -62,6 +62,9 @@ namespace MyEditor
 				case PlatformType.IOS:
 					buildTarget = BuildTarget.iOS;
 					break;
+				case PlatformType.WebGL:
+					buildTarget = BuildTarget.WebGL;
+					break;
 			}
 
 			string fold = string.Format(BuildFolder, type);

+ 3 - 0
Unity/Assets/Scripts/Component/Config/GlobalProto.cs

@@ -12,9 +12,12 @@
 			url += "Android/";
 #elif UNITY_IOS
 			url += "IOS/";
+#elif UNITY_WEBGL
+			url += "WebGL/";
 #else
 			url += "PC/";
 #endif
+			Log.Debug(url);
 			return url;
 		}
 	}

+ 0 - 1
Unity/ProjectSettings/GraphicsSettings.asset

@@ -36,7 +36,6 @@ GraphicsSettings:
   - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
   - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0}
   - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
-  - {fileID: 16002, guid: 0000000000000000f000000000000000, type: 0}
   m_PreloadedShaders: []
   m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
     type: 0}

+ 1 - 0
Unity/ProjectSettings/ProjectSettings.asset

@@ -596,6 +596,7 @@ PlayerSettings:
     1: NET45;ILRuntime
     4: NET45
     7: NET45;ILRuntime
+    13: NET45;ILRuntime
   platformArchitecture:
     iOS: 2
   scriptingBackend:

+ 3 - 0
Unity/Unity.Editor.Plugins.csproj

@@ -131,6 +131,9 @@
     <Reference Include="UnityEditor.Android.Extensions">
       <HintPath>C:/Apps/Unity2017.1.3p2/Editor/Data/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll</HintPath>
     </Reference>
+    <Reference Include="UnityEditor.WebGL.Extensions">
+      <HintPath>C:/Apps/Unity2017.1.3p2/Editor/Data/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll</HintPath>
+    </Reference>
     <Reference Include="UnityEditor.WindowsStandalone.Extensions">
       <HintPath>C:/Apps/Unity2017.1.3p2/Editor/Data/PlaybackEngines/windowsstandalonesupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
     </Reference>

+ 3 - 0
Unity/Unity.Editor.csproj

@@ -131,6 +131,9 @@
     <Reference Include="UnityEditor.Android.Extensions">
       <HintPath>C:/Apps/Unity2017.1.3p2/Editor/Data/PlaybackEngines/AndroidPlayer/UnityEditor.Android.Extensions.dll</HintPath>
     </Reference>
+    <Reference Include="UnityEditor.WebGL.Extensions">
+      <HintPath>C:/Apps/Unity2017.1.3p2/Editor/Data/PlaybackEngines/WebGLSupport/UnityEditor.WebGL.Extensions.dll</HintPath>
+    </Reference>
     <Reference Include="UnityEditor.WindowsStandalone.Extensions">
       <HintPath>C:/Apps/Unity2017.1.3p2/Editor/Data/PlaybackEngines/windowsstandalonesupport/UnityEditor.WindowsStandalone.Extensions.dll</HintPath>
     </Reference>

+ 5 - 8
Unity/Unity.csproj

@@ -12,16 +12,13 @@
     <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>
     <UnityProjectGenerator>VSTU</UnityProjectGenerator>
     <UnityProjectType>Game:1</UnityProjectType>
     <UnityBuildTarget>StandaloneWindows64:19</UnityBuildTarget>
     <UnityVersion>2017.1.3p2</UnityVersion>
-    <RootNamespace>
-    </RootNamespace>
+    <RootNamespace></RootNamespace>
     <LangVersion>6</LangVersion>
   </PropertyGroup>
   <PropertyGroup>
@@ -158,8 +155,8 @@
     <Compile Include="Assets\Scripts\Base\Object\EventProxy.cs" />
     <Compile Include="Assets\Scripts\Base\Object\EventSystem.cs" />
     <Compile Include="Assets\Scripts\Base\Object\IAwakeSystem.cs" />
-    <Compile Include="Assets\Scripts\Base\Object\IDestroySystem.cs" />
     <Compile Include="Assets\Scripts\Base\Object\IChangeSystem.cs" />
+    <Compile Include="Assets\Scripts\Base\Object\IDestroySystem.cs" />
     <Compile Include="Assets\Scripts\Base\Object\ILateUpdateSystem.cs" />
     <Compile Include="Assets\Scripts\Base\Object\ILoadSystem.cs" />
     <Compile Include="Assets\Scripts\Base\Object\ISerializeToEntity.cs" />
@@ -776,4 +773,4 @@
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="GenerateTargetFrameworkMonikerAttribute" />
-</Project>
+</Project>