diff --git a/Assets/00.StaryEvo/Editor/MarkAdressable/MarkAdressable.cs b/Assets/00.StaryEvo/Editor/MarkAdressable/MarkAdressable.cs index a541ccb..0ac5fc3 100644 --- a/Assets/00.StaryEvo/Editor/MarkAdressable/MarkAdressable.cs +++ b/Assets/00.StaryEvo/Editor/MarkAdressable/MarkAdressable.cs @@ -26,7 +26,6 @@ namespace Stary.Evo.Editor } - //[MenuItem("Evo/Hotfix/Addressable")] public static void AddHotfixAddressableDll() { @@ -160,12 +159,12 @@ namespace Stary.Evo.Editor AssetDatabase.LoadAssetAtPath(configPath); packageName = domainConfig.domain; Mark(); - //CollectSVC(); - + + CreateRes(packageName, $"{DomainRoot}/{BuildAssetWindow.GetBuildPackageName()}/AddressableRes", $"{DomainRoot}/{BuildAssetWindow.GetBuildPackageName()}/HotUpdate"); - + CollectSVC(); EditorUtility.DisplayDialog("自动标记", "自动标记成功", "确定"); } @@ -236,14 +235,14 @@ namespace Stary.Evo.Editor ///自动创建图集 Debug.Log("开始创建图集"); AutoCreateSpriteAtlas(remotedRoot); - AssetDatabase.SaveAssets(); - AssetDatabase.Refresh(); + // AssetDatabase.SaveAssets(); + // AssetDatabase.Refresh(); MarkStatus(); YooAsset.Editor.AssetBundleCollectorSettingData.SaveFile(); // CreateRes(); - + Debug.Log("MarkAsset Successful"); } @@ -445,7 +444,7 @@ namespace Stary.Evo.Editor } #endregion - + /// /// 标记为资源分组 /// @@ -470,21 +469,29 @@ namespace Stary.Evo.Editor package.Groups.Remove(deleteList[i]); } } - + public static void CollectSVC() { - string remotedRoot = $"{DomainRoot}/{packageName}/AddressableRes"; - remotedRoot += $"/ShaderVariants/{BuildAssetWindow.GetBuildPackageName()}.shadervariants"; - - string localSavePath = FilesUtils.AbsoluteToRelativePath("Assets", remotedRoot); //Asset到文件的路径 + string remotedRoot = $"{DomainRoot}/{packageName}/ShaderVariants"; + string remotedRootFileName = $"{remotedRoot}/{BuildAssetWindow.GetBuildPackageName()}.shadervariants"; + if (!Directory.Exists(remotedRoot)) + { + Directory.CreateDirectory(remotedRoot); + AssetDatabase.Refresh(); + } + + string localSavePath = FilesUtils.AbsoluteToRelativePath("Assets", remotedRootFileName); //Asset到文件的路径 + System.Action completedCallback = () => { ShaderVariantCollection collection = AssetDatabase.LoadAssetAtPath(localSavePath); if (collection != null) { - Debug.Log($"UnityEvo:【{BuildAssetWindow.GetBuildPackageName()}】ShaderCount : {collection.shaderCount}"); - Debug.Log($"UnityEvo:【{BuildAssetWindow.GetBuildPackageName()}】VariantCount : {collection.variantCount}"); + Debug.Log( + $"UnityEvo:【{BuildAssetWindow.GetBuildPackageName()}】ShaderCount : {collection.shaderCount}"); + Debug.Log( + $"UnityEvo:【{BuildAssetWindow.GetBuildPackageName()}】VariantCount : {collection.variantCount}"); string groupname = "ShaderVariants"; AssetBundleCollectorGroup collectorGroup = null; @@ -495,10 +502,10 @@ namespace Stary.Evo.Editor } else { - collectorGroup = + collectorGroup = YooAsset.Editor.AssetBundleCollectorSettingData.CreateGroup(package, "ShaderVariants"); } - + var guid = AssetDatabase.AssetPathToGUID(localSavePath); AssetBundleCollector collector = new AssetBundleCollector() { @@ -518,8 +525,7 @@ namespace Stary.Evo.Editor throw new Exception("Failed to Collect shader Variants."); } }; - ShaderVariantCollector.Run(localSavePath,BuildAssetWindow.GetBuildPackageName(),1000, completedCallback); + ShaderVariantCollector.Run(localSavePath, BuildAssetWindow.GetBuildPackageName(), 1000, completedCallback); } - } } \ No newline at end of file diff --git a/Assets/00.StaryEvo/package.json b/Assets/00.StaryEvo/package.json index 2c0cb9b..ece4765 100644 --- a/Assets/00.StaryEvo/package.json +++ b/Assets/00.StaryEvo/package.json @@ -1,6 +1,6 @@ { "name": "com.staryevo.main", - "version": "1.3.17", + "version": "1.3.18", "displayName": "00.StaryEvo", "description": "This is an Framework package(后台服务器版本,端口9527)", "unity": "2021.3",