Example #1
0
        private static AssetBundleFolderInfoConcrete AddFoldersToBundle(AssetBundleFolderInfo root, AssetBundleNameInfo nameData)
        {
            AssetBundleInfo assetBundleInfo = root;
            var             folder          = assetBundleInfo as AssetBundleFolderInfoConcrete;
            var             size            = nameData.pathTokens.Count;

            for (var index = 0; index < size; index++)
            {
                if (folder != null)
                {
                    assetBundleInfo = folder.GetAssetBundleInfoByName(nameData.pathTokens[index]);
                    if (assetBundleInfo == null)
                    {
                        assetBundleInfo = new AssetBundleFolderInfoConcrete(nameData.pathTokens, index + 1, folder);
                        folder.AddChild(assetBundleInfo);
                    }

                    folder = assetBundleInfo as AssetBundleFolderInfoConcrete;
                    if (folder == null)
                    {
                        s_InErrorState = true;
                        LogFolderAndBundleNameConflict(assetBundleInfo.m_Name.fullNativeName);
                        break;
                    }
                }
            }
            return(assetBundleInfo as AssetBundleFolderInfoConcrete);
        }
Example #2
0
        internal static void Refresh()
        {
            s_EmptyMessageString = kProblemEmptyMessage;
            if (s_InErrorState)
            {
                return;
            }

            var assetBundleNames = GetValidateAssetBundleNames();

            if (assetBundleNames != null)
            {
                s_EmptyMessageString = kDefaultEmptyMessage;
                foreach (var assetBundleName in assetBundleNames)
                {
                    AddAssetBundleByName(assetBundleName);
                }
                AddBundlesToUpdate(s_RootLevelBundles.GetChildList());
            }

            if (s_InErrorState)
            {
                s_RootLevelBundles   = new AssetBundleFolderInfoConcrete("", null);
                s_EmptyMessageString = kProblemEmptyMessage;
            }
        }
Example #3
0
        internal static AssetBundleFolderInfo CreateEmptyBundleFolder(AssetBundleFolderInfoConcrete folder = null)
        {
            folder = (folder == null) ? s_RootLevelBundles : folder;
            string name = GetUniqueName(folder) + "/dummy";
            AssetBundleNameInfo nameData = new AssetBundleNameInfo(folder.m_Name.bundleName, name);

            return(AddFoldersToBundle(s_RootLevelBundles, nameData));
        }
Example #4
0
 /// <summary>
 ///     <para> Clears and rebuilds model data. </para>
 /// </summary>
 public static void Rebuild()
 {
     s_RootLevelBundles       = new AssetBundleFolderInfoConcrete("", null);
     s_MoveDatas              = new List <AssetBundleMoveData>();
     s_UpdateAssetBundleInfos = new List <AssetBundleInfo>();
     s_GlobalAssetList        = new Dictionary <string, AssetInfo>();
     Refresh();
 }