internal static HashSet <string> GetGroupGuidsWithUnchangedBundleName(AddressableAssetSettings settings, Dictionary <AddressableAssetEntry, List <AddressableAssetEntry> > dependencyMap, AddressablesContentState cacheData)
        {
            var result = new HashSet <string>();

            if (cacheData == null)
            {
                return(result);
            }

            Dictionary <string, string> groupGuidToCacheBundleName = GetGroupGuidToCacheBundleNameMap(cacheData);

            foreach (AddressableAssetGroup group in settings.groups)
            {
                if (group == null || !group.HasSchema <BundledAssetGroupSchema>())
                {
                    continue;
                }

                var schema = group.GetSchema <BundledAssetGroupSchema>();
                List <AssetBundleBuild> bundleInputDefinitions = new List <AssetBundleBuild>();

                BuildScriptPackedMode.PrepGroupBundlePacking(group, bundleInputDefinitions, schema, x => !dependencyMap.ContainsKey(x));
                BuildScriptPackedMode.HandleDuplicateBundleNames(bundleInputDefinitions);

                for (int i = 0; i < bundleInputDefinitions.Count; i++)
                {
                    string bundleName = Path.GetFileNameWithoutExtension(bundleInputDefinitions[i].assetBundleName);
                    if (groupGuidToCacheBundleName.TryGetValue(group.Guid, out string cacheBundleName) && cacheBundleName == bundleName)
                    {
                        result.Add(group.Guid);
                    }
                }
            }
            return(result);
        }
        public void HandleBundlesNaming_NamesShouldAlwaysBeUnique(List <AssetBundleBuild> bundleBuilds)
        {
            var group = Settings.CreateGroup("PackedTest", false, false, false, null, typeof(BundledAssetGroupSchema));
            var bundleToAssetGroup = new Dictionary <string, string>();

            m_BuildScript.HandleDuplicateBundleNames(bundleBuilds, bundleToAssetGroup, group.Guid, out var uniqueNames);

            var uniqueNamesInBundleBuilds = bundleBuilds.Select(b => b.assetBundleName).Distinct();

            Assert.AreEqual(bundleBuilds.Count, uniqueNames.Count());
            Assert.AreEqual(bundleBuilds.Count, uniqueNamesInBundleBuilds.Count());
            Assert.AreEqual(bundleBuilds.Count, bundleToAssetGroup.Count);
        }