Beispiel #1
0
        private static string GetUniqueName(BundleFolderInfo folder)
        {
            string name          = kNewBundleBaseName;
            int    index         = 1;
            bool   foundExisting = (folder.GetChild(name) != null);

            while (foundExisting)
            {
                name = kNewBundleBaseName + index;
                index++;
                foundExisting = (folder.GetChild(name) != null);
            }
            return(name);
        }
Beispiel #2
0
        private static string GetUniqueName(BundleFolderInfo folder, string suggestedName = null)
        {
            suggestedName = (suggestedName == null) ? k_NewBundleBaseName : suggestedName;
            string name          = suggestedName;
            int    index         = 1;
            bool   foundExisting = (folder.GetChild(name) != null);

            while (foundExisting)
            {
                name = suggestedName + index;
                index++;
                foundExisting = (folder.GetChild(name) != null);
            }
            return(name);
        }
Beispiel #3
0
        private static BundleInfo AddBundleToFolder(BundleFolderInfo root, BundleNameData nameData)
        {
            BundleInfo currInfo = root.GetChild(nameData.ShortName);

            if (currInfo == null)
            {
                currInfo = new BundleDataInfo(nameData.Name, root);
                root.AddChild(currInfo);
            }
            return(currInfo);
        }
Beispiel #4
0
        private static BundleInfo AddBundleToFolder(BundleFolderInfo root, BundleNameData nameData)
        {
            BundleInfo currInfo = root.GetChild(nameData.shortName);

            if (nameData.variant != string.Empty)
            {
                if (currInfo == null)
                {
                    currInfo = new BundleVariantFolderInfo(nameData.bundleName, root);
                    root.AddChild(currInfo);
                }
                var folder = currInfo as BundleVariantFolderInfo;
                if (folder == null)
                {
                    var message = "Bundle named " + nameData.shortName;
                    message += " exists both as a standard bundle, and a bundle with variants.  ";
                    message += "This message is not supported for display or actual bundle building.  ";
                    message += "You must manually fix bundle naming in the inspector.";

                    LogError(message);
                    return(null);
                }


                currInfo = folder.GetChild(nameData.variant);
                if (currInfo == null)
                {
                    currInfo = new BundleVariantDataInfo(nameData.fullNativeName, folder);
                    folder.AddChild(currInfo);
                }
            }
            else
            {
                if (currInfo == null)
                {
                    currInfo = new BundleDataInfo(nameData.fullNativeName, root);
                    root.AddChild(currInfo);
                }
                else
                {
                    var dataInfo = currInfo as BundleDataInfo;
                    if (dataInfo == null)
                    {
                        m_InErrorState = true;
                        LogError("Bundle " + nameData.fullNativeName + " has a name conflict with a bundle-folder.  Display of bundle data and building of bundles will not work.");
                    }
                }
            }
            return(currInfo);
        }