Example #1
0
        private static BundleFolderConcreteInfo AddFoldersToBundle(BundleFolderInfo root, BundleNameData nameData)
        {
            BundleInfo currInfo = root;
            var        folder   = currInfo as BundleFolderConcreteInfo;
            var        size     = nameData.pathTokens.Count;

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

                    folder = currInfo as BundleFolderConcreteInfo;
                    if (folder == null)
                    {
                        m_InErrorState = true;
                        LogFolderAndBundleNameConflict(currInfo.m_Name.fullNativeName);
                        break;
                    }
                }
            }
            return(currInfo as BundleFolderConcreteInfo);
        }
Example #2
0
        public static void Refresh()
        {
            m_EmptyMessageString = k_ProblemEmptyMessage;
            if (m_InErrorState)
            {
                return;
            }

            var bundleList = ValidateBundleList();

            if (bundleList != null)
            {
                m_EmptyMessageString = k_DefaultEmptyMessage;
                foreach (var bundleName in bundleList)
                {
                    AddBundleToModel(bundleName);
                }
                AddBundlesToUpdate(m_RootLevelBundles.GetChildList());
            }

            if (m_InErrorState)
            {
                m_RootLevelBundles   = new BundleFolderConcreteInfo("", null);
                m_EmptyMessageString = k_ProblemEmptyMessage;
            }
        }
Example #3
0
 public static void Rebuild()
 {
     m_RootLevelBundles = new BundleFolderConcreteInfo("", null);
     m_MoveData         = new List <ABMoveData>();
     m_BundlesToUpdate  = new List <BundleInfo>();
     m_GlobalAssetList  = new Dictionary <string, AssetInfo>();
     Refresh();
 }
Example #4
0
        public static BundleFolderInfo CreateEmptyBundleFolder(BundleFolderConcreteInfo folder = null)
        {
            folder = (folder == null) ? m_RootLevelBundles : folder;
            string         name     = GetUniqueName(folder) + "/dummy";
            BundleNameData nameData = new BundleNameData(folder.m_Name.bundleName, name);

            return(AddFoldersToBundle(m_RootLevelBundles, nameData));
        }
Example #5
0
        void CreateNewSiblingBundle(object context)
        {
            var selectedNodes = context as List <AssetBundleModel.BundleTreeItem>;

            if (selectedNodes != null && selectedNodes.Count > 0)
            {
                AssetBundleModel.BundleFolderConcreteInfo folder = null;
                folder = selectedNodes[0].bundle.parent as AssetBundleModel.BundleFolderConcreteInfo;
                CreateBundleUnderParent(folder);
            }
            else
            {
                Debug.LogError("could not add 'sibling' with no bundles selected");
            }
        }
Example #6
0
        void CreateFolderUnderParent(AssetBundleModel.BundleFolderConcreteInfo folder)
        {
            var newBundle = AssetBundleModel.Model.CreateEmptyBundleFolder(folder);

            ReloadAndSelect(newBundle.nameHashCode, true);
        }