瀏覽代碼

yooasset打包测试

guodong 1 年之前
父節點
當前提交
b3db264ce7

+ 1 - 1
GameClient/Assets/AssetBundleBuilderSetting.asset

@@ -13,7 +13,7 @@ MonoBehaviour:
   m_Name: AssetBundleBuilderSetting
   m_Name: AssetBundleBuilderSetting
   m_EditorClassIdentifier: 
   m_EditorClassIdentifier: 
   BuildPipeline: 0
   BuildPipeline: 0
-  BuildMode: 0
+  BuildMode: 1
   BuildPackage: GameLogic
   BuildPackage: GameLogic
   CompressOption: 2
   CompressOption: 2
   OutputNameStyle: 1
   OutputNameStyle: 1

+ 6 - 0
GameClient/Assets/Editor/BuildEditor/BuildDllHelper.cs

@@ -9,6 +9,12 @@ namespace GFGEditor
 {
 {
     public class BuildDllHelper
     public class BuildDllHelper
     {
     {
+        [InitializeOnLoadMethod]
+        public static void Init()
+        {
+            AssetBundleHelper.BuildHotUpdateDll = BuildHotUpdateDll;
+        }
+
         public static void BuildHotUpdateDll()
         public static void BuildHotUpdateDll()
         {
         {
             CompileDllCommand.CompileDllActiveBuildTarget();
             CompileDllCommand.CompileDllActiveBuildTarget();

+ 0 - 45
GameClient/Assets/Editor/BuildEditor/BuildHotfixEditor.cs

@@ -1,45 +0,0 @@
-using System.IO;
-using UnityEditor;
-using UnityEngine;
-using GFGGame;
-
-namespace GFGEditor
-{
-    [InitializeOnLoad]
-    public class BuildHotfixEditor
-    {
-        //Unity代码生成dll位置
-        private const string ScriptAssembliesDir = "Library/ScriptAssemblies";
-        //热更代码dll文件
-        private const string HotfixDll = "Game.HotUpdate.dll";
-        //热更代码pdb文件
-        private const string HotfixPdb = "Game.HotUpdate.pdb";
-        //热更代码存放位置
-        private const string CodeDir = LauncherConfig.DllDirHotfix;
-        //热更代码存放位置
-        private const string EditorDllDir = "Assets/Editor/Excel/DLL/";
-
-        static BuildHotfixEditor()
-        {
-            //CopyCode();
-        }
-
-        static void CopyCode()
-        {
-            Debug.Log($"Copy Hotfix Code");
-            if (!Directory.Exists(CodeDir))
-                Directory.CreateDirectory(CodeDir);
-            var path = Path.Combine(ScriptAssembliesDir, HotfixDll);
-            if (File.Exists(path))
-            {
-                File.Copy(path, Path.Combine(CodeDir, "Game.HotUpdate.dll.bytes"), true);
-                //File.Delete(path);
-                path = Path.Combine(ScriptAssembliesDir, HotfixPdb);
-                File.Copy(path, Path.Combine(CodeDir, "Game.HotUpdate.pdb.bytes"), true);
-                //File.Delete(path);
-                Debug.Log($"复制Game.HotUpdate.dll, Game.HotUpdate.pdb到Res/Code完成");
-                AssetDatabase.Refresh();
-            }
-        }
-    }
-}

+ 0 - 11
GameClient/Assets/Editor/BuildEditor/BuildHotfixEditor.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: f249fd6ea2f49a3409417d52aafd79b0
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 2 - 2
GameClient/Assets/Game/HotUpdate/FairyGUI/GFGUIPackage.cs

@@ -1,8 +1,8 @@
 using FairyGUI;
 using FairyGUI;
 using System.Collections.Generic;
 using System.Collections.Generic;
-using System.Threading.Tasks;
 using UnityEngine;
 using UnityEngine;
 using YooAsset;
 using YooAsset;
+using ET;
 
 
 namespace GFGGame
 namespace GFGGame
 {
 {
@@ -40,7 +40,7 @@ namespace GFGGame
             _packages.Add(descFilePath, uiPackage);
             _packages.Add(descFilePath, uiPackage);
         }
         }
 
 
-        public static async Task AddPackageAsync(string descFilePath)
+        public static async ETTask AddPackageAsync(string descFilePath)
         {
         {
             _assetCount.TryGetValue(descFilePath, out var count);
             _assetCount.TryGetValue(descFilePath, out var count);
             if (count > 0)
             if (count > 0)

+ 0 - 4
GameClient/Assets/Game/HotUpdate/HotUpdateEntry.cs

@@ -11,10 +11,6 @@ namespace GFGGame.HotUpdate
             //UniFramework
             //UniFramework
             // 初始化对象池系统
             // 初始化对象池系统
             UniPooling.Initalize();
             UniPooling.Initalize();
-            //Reporter
-            Reporter reporter = GameObject.Find("Reporter").GetComponent<Reporter>();
-            reporter.numOfCircleToShow = 10;
-            reporter.isOpen = LauncherConfig.onDebug > 0;
             //Litjson
             //Litjson
             LitJson.UnityTypeBindings.Register();
             LitJson.UnityTypeBindings.Register();
             //ET
             //ET

+ 9 - 0
GameClient/Assets/Game/Launcher/LauncherController.cs

@@ -38,7 +38,9 @@ namespace GFGGame
 
 
         public static void CheckGameStatus()
         public static void CheckGameStatus()
         {
         {
+            InitReporter();
             InitBugly();
             InitBugly();
+
             if (LauncherConfig.serverStatus == 1)
             if (LauncherConfig.serverStatus == 1)
             {
             {
                 Alert.Show("游戏正在维护中,请稍后再试。")
                 Alert.Show("游戏正在维护中,请稍后再试。")
@@ -99,6 +101,13 @@ namespace GFGGame
             HotUpdateCodeLoader.Instance.StartLoad();
             HotUpdateCodeLoader.Instance.StartLoad();
         }
         }
 
 
+        private static void InitReporter()
+        {
+            Reporter reporter = GameObject.Find("Reporter").GetComponent<Reporter>();
+            reporter.numOfCircleToShow = 10;
+            reporter.isOpen = LauncherConfig.onDebug > 0;
+        }
+
         private static void InitBugly()
         private static void InitBugly()
         {
         {
 
 

+ 4 - 1
GameClient/Assets/Game/Launcher/Version/VersionController.cs

@@ -43,6 +43,9 @@ namespace GFGGame
             }
             }
 
 
             var playMode = GameLauncher.Instance.PlayMode;
             var playMode = GameLauncher.Instance.PlayMode;
+#if !UNITY_EDITOR
+            playMode = EPlayMode.HostPlayMode;
+#endif
             InitializationOperation initializationOperation = null;
             InitializationOperation initializationOperation = null;
             if (playMode == EPlayMode.EditorSimulateMode)
             if (playMode == EPlayMode.EditorSimulateMode)
             {
             {
@@ -147,7 +150,7 @@ namespace GFGGame
                 {
                 {
                     string currentSizeMB = (currentDownloadSizeBytes / 1048576f).ToString("f1");
                     string currentSizeMB = (currentDownloadSizeBytes / 1048576f).ToString("f1");
                     string totalSizeMB = (totalDownloadSizeBytes / 1048576f).ToString("f1");
                     string totalSizeMB = (totalDownloadSizeBytes / 1048576f).ToString("f1");
-                    var progress = currentDownloadSizeBytes / totalDownloadSizeBytes;
+                    var progress = (float)currentDownloadSizeBytes / totalDownloadSizeBytes;
                     LauncherView.Instance.SetDesc($"正在下载资源,{currentDownloadCount}/{totalDownloadCount}", $"{currentSizeMB}MB/{totalSizeMB}MB", true);
                     LauncherView.Instance.SetDesc($"正在下载资源,{currentDownloadCount}/{totalDownloadCount}", $"{currentSizeMB}MB/{totalSizeMB}MB", true);
                     LauncherView.Instance.SetProgress((int)(progress * 100));
                     LauncherView.Instance.SetProgress((int)(progress * 100));
                 };
                 };

二進制
GameClient/Assets/ResIn/UI/PopWindow_atlas0!a.png


+ 0 - 96
GameClient/Assets/ResIn/UI/PopWindow_atlas0!a.png.meta

@@ -1,96 +0,0 @@
-fileFormatVersion: 2
-guid: 67fee5d0d0de7d646a81eb188e2d25cc
-TextureImporter:
-  internalIDToNameTable: []
-  externalObjects: {}
-  serializedVersion: 11
-  mipmaps:
-    mipMapMode: 0
-    enableMipMap: 0
-    sRGBTexture: 1
-    linearTexture: 0
-    fadeOut: 0
-    borderMipMap: 0
-    mipMapsPreserveCoverage: 0
-    alphaTestReferenceValue: 0.5
-    mipMapFadeDistanceStart: 1
-    mipMapFadeDistanceEnd: 3
-  bumpmap:
-    convertToNormalMap: 0
-    externalNormalMap: 0
-    heightScale: 0.25
-    normalMapFilter: 0
-  isReadable: 0
-  streamingMipmaps: 0
-  streamingMipmapsPriority: 0
-  vTOnly: 0
-  grayScaleToAlpha: 0
-  generateCubemap: 6
-  cubemapConvolution: 0
-  seamlessCubemap: 0
-  textureFormat: 1
-  maxTextureSize: 2048
-  textureSettings:
-    serializedVersion: 2
-    filterMode: 1
-    aniso: 1
-    mipBias: 0
-    wrapU: 1
-    wrapV: 1
-    wrapW: 1
-  nPOTScale: 0
-  lightmap: 0
-  compressionQuality: 50
-  spriteMode: 1
-  spriteExtrude: 1
-  spriteMeshType: 1
-  alignment: 0
-  spritePivot: {x: 0.5, y: 0.5}
-  spritePixelsToUnits: 100
-  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
-  spriteGenerateFallbackPhysicsShape: 1
-  alphaUsage: 1
-  alphaIsTransparency: 1
-  spriteTessellationDetail: -1
-  textureType: 8
-  textureShape: 1
-  singleChannelComponent: 0
-  flipbookRows: 1
-  flipbookColumns: 1
-  maxTextureSizeSet: 0
-  compressionQualitySet: 0
-  textureFormatSet: 0
-  ignorePngGamma: 0
-  applyGammaDecoding: 0
-  platformSettings:
-  - serializedVersion: 3
-    buildTarget: DefaultTexturePlatform
-    maxTextureSize: 2048
-    resizeAlgorithm: 0
-    textureFormat: -1
-    textureCompression: 1
-    compressionQuality: 50
-    crunchedCompression: 0
-    allowsAlphaSplitting: 0
-    overridden: 0
-    androidETC2FallbackOverride: 0
-    forceMaximumCompressionQuality_BC6H_BC7: 0
-  spriteSheet:
-    serializedVersion: 2
-    sprites: []
-    outline: []
-    physicsShape: []
-    bones: []
-    spriteID: 5e97eb03825dee720800000000000000
-    internalID: 0
-    vertices: []
-    indices: 
-    edges: []
-    weights: []
-    secondaryTextures: []
-  spritePackingTag: 
-  pSDRemoveMatte: 0
-  pSDShowRemoveMatteOption: 0
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

二進制
GameClient/Assets/ResIn/UI/PopWindow_atlas0.png


+ 2 - 3
GameClient/Assets/YooAsset/Editor/GFGAsset/Collect/AssetBundleHelper.cs

@@ -1,15 +1,13 @@
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.IO;
 using System.IO;
-using System.Linq;
 using UnityEditor;
 using UnityEditor;
-using YooAsset.Editor;
-using static UnityEditor.Progress;
 
 
 namespace GFGEditor
 namespace GFGEditor
 {
 {
     public static class AssetBundleHelper
     public static class AssetBundleHelper
     {
     {
+        public static Action BuildHotUpdateDll;
         public const string RES_ROOT_DIR_PATH = "Assets/Res";
         public const string RES_ROOT_DIR_PATH = "Assets/Res";
         public const int LimitByteSize = 1024*1024*4;
         public const int LimitByteSize = 1024*1024*4;
         private static List<string> excludeFileExtensions = new List<string>() { ".meta", ".moc3" , ".can3" };
         private static List<string> excludeFileExtensions = new List<string>() { ".meta", ".moc3" , ".can3" };
@@ -36,6 +34,7 @@ namespace GFGEditor
         public static void OnPreExecuteBuild()
         public static void OnPreExecuteBuild()
         {
         {
             EditorUtility.DisplayProgressBar("进度", "正在收集资源", 1);
             EditorUtility.DisplayProgressBar("进度", "正在收集资源", 1);
+            BuildHotUpdateDll();
             itemsSizeDicDic = new Dictionary<string, Dictionary<string, AssetBundleAssetListItem>>();
             itemsSizeDicDic = new Dictionary<string, Dictionary<string, AssetBundleAssetListItem>>();
             assetBundleCollector = AssetBundleCollector.GetData();
             assetBundleCollector = AssetBundleCollector.GetData();
             
             

+ 2 - 2
GameClient/ProjectSettings/ProjectSettings.asset

@@ -13,7 +13,7 @@ PlayerSettings:
   useOnDemandResources: 0
   useOnDemandResources: 0
   accelerometerFrequency: 60
   accelerometerFrequency: 60
   companyName: gfg
   companyName: gfg
-  productName: "\u4E07\u4E16\u955C\u5185\u7F51"
+  productName: "\u4E07\u4E16\u955Czgd"
   defaultCursor: {fileID: 0}
   defaultCursor: {fileID: 0}
   cursorHotspot: {x: 0, y: 0}
   cursorHotspot: {x: 0, y: 0}
   m_SplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1}
   m_SplashScreenBackgroundColor: {r: 0, g: 0, b: 0, a: 1}
@@ -164,7 +164,7 @@ PlayerSettings:
   androidSupportedAspectRatio: 1
   androidSupportedAspectRatio: 1
   androidMaxAspectRatio: 2.1
   androidMaxAspectRatio: 2.1
   applicationIdentifier:
   applicationIdentifier:
-    Android: com.shenyou.gfg.local
+    Android: com.shenyou.gfg.local.zgd
     Standalone: com.DefaultCompany.GFGClient
     Standalone: com.DefaultCompany.GFGClient
   buildNumber:
   buildNumber:
     Standalone: 0
     Standalone: 0