コード例 #1
0
        string IAddressRule.GetAssetAddress(AddressRuleData data)
        {
            string fileName      = Path.GetFileNameWithoutExtension(data.AssetPath);
            string collectorName = Path.GetFileNameWithoutExtension(data.CollectPath);

            return($"{collectorName}_{fileName}");
        }
コード例 #2
0
        private void RefreshFoldout(Foldout foldout, AssetBundleCollectorGroup group, AssetBundleCollector collector)
        {
            // 清空旧元素
            foldout.Clear();

            if (collector.IsValid() == false)
            {
                Debug.LogWarning($"The collector is invalid : {collector.CollectPath} in group : {group.GroupName}");
                return;
            }

            if (collector.CollectorType == ECollectorType.MainAssetCollector || collector.CollectorType == ECollectorType.StaticAssetCollector)
            {
                List <CollectAssetInfo> collectAssetInfos = null;

                try
                {
                    collectAssetInfos = collector.GetAllCollectAssets(group);
                }
                catch (System.Exception e)
                {
                    Debug.LogError(e.ToString());
                }

                if (collectAssetInfos != null)
                {
                    foreach (var collectAssetInfo in collectAssetInfos)
                    {
                        VisualElement elementRow = new VisualElement();
                        elementRow.style.flexDirection = FlexDirection.Row;
                        foldout.Add(elementRow);

                        string showInfo = collectAssetInfo.AssetPath;
                        if (_enableAddressableToogle.value)
                        {
                            IAddressRule    instance     = AssetBundleCollectorSettingData.GetAddressRuleInstance(collector.AddressRuleName);
                            AddressRuleData ruleData     = new AddressRuleData(collectAssetInfo.AssetPath, collector.CollectPath, group.GroupName);
                            string          addressValue = instance.GetAssetAddress(ruleData);
                            showInfo = $"[{addressValue}] {showInfo}";
                        }

                        var label = new Label();
                        label.text             = showInfo;
                        label.style.width      = 300;
                        label.style.marginLeft = 0;
                        label.style.flexGrow   = 1;
                        elementRow.Add(label);
                    }
                }
            }
        }
コード例 #3
0
 string IAddressRule.GetAssetAddress(AddressRuleData data)
 {
     return(Path.GetFileNameWithoutExtension(data.AssetPath));
 }
コード例 #4
0
        string IAddressRule.GetAssetAddress(AddressRuleData data)
        {
            string fileName = Path.GetFileNameWithoutExtension(data.AssetPath);

            return($"{data.GroupName}_{fileName}");
        }