【m】shader变体测试

This commit is contained in:
2025-07-22 14:07:25 +08:00
parent 377828df7e
commit d277338f90
2 changed files with 26 additions and 20 deletions

View File

@@ -26,7 +26,6 @@ namespace Stary.Evo.Editor
} }
//[MenuItem("Evo/Hotfix/Addressable")] //[MenuItem("Evo/Hotfix/Addressable")]
public static void AddHotfixAddressableDll() public static void AddHotfixAddressableDll()
{ {
@@ -160,12 +159,12 @@ namespace Stary.Evo.Editor
AssetDatabase.LoadAssetAtPath<DomainConfig>(configPath); AssetDatabase.LoadAssetAtPath<DomainConfig>(configPath);
packageName = domainConfig.domain; packageName = domainConfig.domain;
Mark(); Mark();
//CollectSVC();
CreateRes(packageName, CreateRes(packageName,
$"{DomainRoot}/{BuildAssetWindow.GetBuildPackageName()}/AddressableRes", $"{DomainRoot}/{BuildAssetWindow.GetBuildPackageName()}/AddressableRes",
$"{DomainRoot}/{BuildAssetWindow.GetBuildPackageName()}/HotUpdate"); $"{DomainRoot}/{BuildAssetWindow.GetBuildPackageName()}/HotUpdate");
CollectSVC();
EditorUtility.DisplayDialog("自动标记", "自动标记成功", "确定"); EditorUtility.DisplayDialog("自动标记", "自动标记成功", "确定");
} }
@@ -236,8 +235,8 @@ namespace Stary.Evo.Editor
///自动创建图集 ///自动创建图集
Debug.Log("开始创建图集"); Debug.Log("开始创建图集");
AutoCreateSpriteAtlas(remotedRoot); AutoCreateSpriteAtlas(remotedRoot);
AssetDatabase.SaveAssets(); // AssetDatabase.SaveAssets();
AssetDatabase.Refresh(); // AssetDatabase.Refresh();
MarkStatus(); MarkStatus();
YooAsset.Editor.AssetBundleCollectorSettingData.SaveFile(); YooAsset.Editor.AssetBundleCollectorSettingData.SaveFile();
@@ -473,18 +472,26 @@ namespace Stary.Evo.Editor
public static void CollectSVC() public static void CollectSVC()
{ {
string remotedRoot = $"{DomainRoot}/{packageName}/AddressableRes"; string remotedRoot = $"{DomainRoot}/{packageName}/ShaderVariants";
remotedRoot += $"/ShaderVariants/{BuildAssetWindow.GetBuildPackageName()}.shadervariants"; string remotedRootFileName = $"{remotedRoot}/{BuildAssetWindow.GetBuildPackageName()}.shadervariants";
if (!Directory.Exists(remotedRoot))
{
Directory.CreateDirectory(remotedRoot);
AssetDatabase.Refresh();
}
string localSavePath = FilesUtils.AbsoluteToRelativePath("Assets", remotedRootFileName); //Asset到文件的路径
string localSavePath = FilesUtils.AbsoluteToRelativePath("Assets", remotedRoot); //Asset到文件的路径
System.Action completedCallback = () => System.Action completedCallback = () =>
{ {
ShaderVariantCollection collection = ShaderVariantCollection collection =
AssetDatabase.LoadAssetAtPath<ShaderVariantCollection>(localSavePath); AssetDatabase.LoadAssetAtPath<ShaderVariantCollection>(localSavePath);
if (collection != null) if (collection != null)
{ {
Debug.Log($"UnityEvo:【{BuildAssetWindow.GetBuildPackageName()}】ShaderCount : {collection.shaderCount}"); Debug.Log(
Debug.Log($"UnityEvo:【{BuildAssetWindow.GetBuildPackageName()}】VariantCount : {collection.variantCount}"); $"UnityEvo:【{BuildAssetWindow.GetBuildPackageName()}】ShaderCount : {collection.shaderCount}");
Debug.Log(
$"UnityEvo:【{BuildAssetWindow.GetBuildPackageName()}】VariantCount : {collection.variantCount}");
string groupname = "ShaderVariants"; string groupname = "ShaderVariants";
AssetBundleCollectorGroup collectorGroup = null; AssetBundleCollectorGroup collectorGroup = null;
@@ -518,8 +525,7 @@ namespace Stary.Evo.Editor
throw new Exception("Failed to Collect shader Variants."); throw new Exception("Failed to Collect shader Variants.");
} }
}; };
ShaderVariantCollector.Run(localSavePath,BuildAssetWindow.GetBuildPackageName(),1000, completedCallback); ShaderVariantCollector.Run(localSavePath, BuildAssetWindow.GetBuildPackageName(), 1000, completedCallback);
} }
} }
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "com.staryevo.main", "name": "com.staryevo.main",
"version": "1.3.17", "version": "1.3.18",
"displayName": "00.StaryEvo", "displayName": "00.StaryEvo",
"description": "This is an Framework package(后台服务器版本端口9527)", "description": "This is an Framework package(后台服务器版本端口9527)",
"unity": "2021.3", "unity": "2021.3",