internal void MergeWith(string fullName)
        {
            AH_SerializedBuildInfo newBuildInfo = AH_SerializationHelper.LoadBuildReport(fullName);

            if (newBuildInfo != null)
            {
                Debug.Log("AH: Merging with " + fullName);
                foreach (var newItem in newBuildInfo.AssetListUnSorted)
                {
                    //If asset ID already exists
                    if (AssetListUnSorted.Any(val => val.ID == newItem.ID))
                    {
                        AH_SerializableAssetInfo OrigItem = AssetListUnSorted.Find(val => val.ID == newItem.ID);
                        //Check if new scene ref list have entries that doesn't exist in orig
                        bool newSceneRefsExist = newItem.Refs.Any(val => !OrigItem.Refs.Contains(val));
                        //Get the new refs
                        if (newSceneRefsExist)
                        {
                            List <string> newSceneRefs = newItem.Refs.FindAll(val => !OrigItem.Refs.Contains(val));
                            //Add them to list
                            OrigItem.Refs.AddRange(newSceneRefs);
                        }
                    }
                    else
                    {
                        AssetListUnSorted.Add(newItem);
                    }
                }
            }
            else
            {
                Debug.Log("AH: Merging failed: " + fullName);
            }
        }
Ejemplo n.º 2
0
        internal void SelectBuildInfo(string filePath)
        {
            hasTreeviewSelection = false;
            chosenFilePath       = filePath;
            chosenBuildInfo      = AH_SerializationHelper.LoadBuildReport(filePath);

            if (chosenBuildInfo == null)
            {
                return;
            }


            //Make sure JSON is valid
            if (populateBuildReport())
            {
                hasTreeviewSelection = true;

                if (OnBuildInfoSelectionChanged != null)
                {
                    OnBuildInfoSelectionChanged();
                }
            }
            else
            {
                EditorUtility.DisplayDialog(
                    "JSON Parse error",
                    "The selected file could not be parsed",
                    "Ok");
            }
        }
Ejemplo n.º 3
0
        public static void Init()
        {
            m_window = GetWindow <AH_BuildInfoMergerWindow>("AH Merger", true, typeof(AH_Window));
            m_window.titleContent.image = AH_EditorData.Instance.MergerIcon.Icon;

            m_window.buildInfoFolder = AH_SerializationHelper.GetBuildInfoFolder();
            m_window.updateBuildInfoFiles();
        }
Ejemplo n.º 4
0
        private void openBuildInfoSelector()
        {
            string fileSelected = EditorUtility.OpenFilePanel("", AH_SerializationHelper.GetBuildInfoFolder(), AH_SerializationHelper.BuildInfoExtension);

            if (!string.IsNullOrEmpty(fileSelected))
            {
                m_Initialized = false;
                buildInfoManager.SelectBuildInfo(fileSelected);
            }
        }
Ejemplo n.º 5
0
        internal void SaveToFile()
        {
            var path = EditorUtility.SaveFilePanel(
                "Save current settings",
                AH_SerializationHelper.GetSettingFolder(),
                "AH_UserPrefs_" + Environment.UserName,
                AH_SerializationHelper.SettingsExtension);

            if (path.Length != 0)
            {
                AH_SerializationHelper.SerializeAndSave(instance, path);
            }

            AssetDatabase.Refresh();
        }
Ejemplo n.º 6
0
        internal void LoadFromFile()
        {
            var path = EditorUtility.OpenFilePanel(
                "settings",
                AH_SerializationHelper.GetSettingFolder(),
                AH_SerializationHelper.SettingsExtension
                );

            if (path.Length != 0)
            {
                AH_SerializationHelper.LoadSettings(instance, path);
                ignoredListTypes.Save();
                ignoredListPathEndsWith.Save();
                ignoredListTypes.Save();
                ignoredListExtensions.Save();
                ignoredListFolders.Save();
            }
        }
        private void exportAssetsToPackage(string header, List <string> affectedAssets)
        {
            string filename = Environment.UserName + "_Backup_" + "_" + AH_SerializationHelper.GetDateString();
            string savePath = EditorUtility.SaveFilePanel(
                header,
                AH_SerializationHelper.GetBackupFolder(),
                filename,
                "unitypackage");

            if (!string.IsNullOrEmpty(savePath))
            {
                EditorUtility.DisplayProgressBar("Backup", "Creating backup of " + affectedAssets.Count() + " assets", 0f);
                AssetDatabase.ExportPackage(affectedAssets.ToArray <string>(), savePath, ExportPackageOptions.Default);
                EditorUtility.ClearProgressBar();
                EditorUtility.RevealInFinder(savePath);

                deleteMultipleAssets(affectedAssets);
            }
        }
Ejemplo n.º 8
0
        internal static void DumpCurrentListToFile(AH_TreeViewWithTreeModel m_TreeView)
        {
            var path = EditorUtility.SaveFilePanel(
                "Dump current list to file",
                AH_SerializationHelper.GetBuildInfoFolder(),
                "AH_Listdump_" + System.Environment.UserName,
                AH_SerializationHelper.FileDumpExtension);

            if (path.Length != 0)
            {
                List <AssetDumpData> elements = new List <AssetDumpData>();

                foreach (var element in m_TreeView.GetRows())
                {
                    populateDumpListRecursively(m_TreeView.treeModel.Find(element.id), ((AH_MultiColumnHeader)m_TreeView.multiColumnHeader).ShowMode, ref elements);
                }

                AH_ElementList objectToSave = new AH_ElementList(elements);
                AH_SerializationHelper.SerializeAndSave(objectToSave, path);
            }
        }
 private void SerializeAndSave()
 {
     setMetaData();
     AH_SerializationHelper.SerializeAndSave(this);
 }
 void setMetaData(string buildTargetInfoString)
 {
     dateTime        = AH_SerializationHelper.GetDateString();
     buildTargetInfo = buildTargetInfoString;
     versionNumber   = AH_Window.VERSION;
 }
 internal void SaveAfterMerge()
 {
     setMetaData(mergeIdentifier);
     AH_SerializationHelper.SerializeAndSave(this);
 }
Ejemplo n.º 12
0
 private void UpdateBuildInfoFilePaths()
 {
     //Create new folder if needed
     Directory.CreateDirectory(AH_SerializationHelper.GetBuildInfoFolder());
 }