From 6488e96127e448751391a8fe840cfd29626745ae Mon Sep 17 00:00:00 2001 From: Sayo Date: Mon, 30 Jan 2023 12:07:34 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E6=B7=BB=E5=8A=A0=E8=B7=A8=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E8=B5=84=E6=BA=90=E6=94=B6=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssetBundleCollector.cs | 26 +++++++++++- .../AssetBundleCollectorWindow.cs | 40 ++++++++++++++++++- .../DefaultAddressRule.cs | 32 +++++++++++++++ .../AssetBundleCollector/IAddressRule.cs | 6 ++- 4 files changed, 101 insertions(+), 3 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs index 8449b7c..0bff9ef 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollector.cs @@ -46,6 +46,16 @@ namespace YooAsset.Editor public string AssetTags = string.Empty; + /// + /// 可寻址路径 + /// + public string Address = string.Empty; + + /// + /// 跨平台 + /// + public bool IsMultiPlatform = false; + /// /// 收集器是否有效 /// @@ -160,6 +170,20 @@ namespace YooAsset.Editor { if (IsValidateAsset(assetPath) && IsCollectAsset(assetPath)) { + if (IsMultiPlatform) + { + string platform = "Windows"; +#if UNITY_ANDROID + platform = "Android"; +#elif UNITY_IOS + platform = "iOS"; +#elif UNITY_STANDALONE_OSX + platform = "OSX"; +#endif + if (!assetPath.Contains(platform)) + continue; + } + if (result.ContainsKey(assetPath) == false) { var collectAssetInfo = CreateCollectAssetInfo(command, group, assetPath, isRawAsset); @@ -281,7 +305,7 @@ namespace YooAsset.Editor return string.Empty; IAddressRule addressRuleInstance = AssetBundleCollectorSettingData.GetAddressRuleInstance(AddressRuleName); - string adressValue = addressRuleInstance.GetAssetAddress(new AddressRuleData(assetPath, CollectPath, group.GroupName)); + string adressValue = addressRuleInstance.GetAssetAddress(new AddressRuleData(assetPath, CollectPath, group.GroupName, Address, IsMultiPlatform)); return adressValue; } private string GetBundleName(AssetBundleCollectorGroup group, string assetPath) diff --git a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorWindow.cs b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorWindow.cs index 486ce7e..3aba38a 100644 --- a/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorWindow.cs +++ b/Assets/YooAsset/Editor/AssetBundleCollector/AssetBundleCollectorWindow.cs @@ -582,6 +582,18 @@ namespace YooAsset.Editor label.style.width = 90; elementBottom.Add(label); } + { + var textField = new TextField(); + textField.name = "TextField0"; + textField.label = "Address"; + textField.style.unityTextAlign = TextAnchor.MiddleLeft; + textField.style.flexGrow = 1f; + elementBottom.Add(textField); + var label = textField.Q