ExtractAndPrepareAssetList() private method

private ExtractAndPrepareAssetList ( string packagePath, string &packageIconPath, bool &canPerformReInstall ) : UnityEditor.ImportPackageItem[]
packagePath string
packageIconPath string
canPerformReInstall bool
return UnityEditor.ImportPackageItem[]
        public static void ImportPackage(string packagePath, bool interactive)
        {
            if (string.IsNullOrEmpty(packagePath))
            {
                throw new ArgumentException("Path can not be empty or null", "packagePath");
            }

            string packageIconPath;
            bool   canPerformReInstall;

            ImportPackageItem[] items = PackageUtility.ExtractAndPrepareAssetList(packagePath, out packageIconPath, out canPerformReInstall);

            if (items == null)
            {
                return;
            }

            if (interactive)
            {
                PackageImport.ShowImportPackage(packagePath, items, packageIconPath, canPerformReInstall);
            }
            else
            {
                string packageName = System.IO.Path.GetFileNameWithoutExtension(packagePath);
                PackageUtility.ImportPackageAssets(packageName, items, false);
            }
        }
Example #2
0
        internal static void ImportPackageImmediately(string packagePath)
        {
            string str;
            bool   flag;

            if (string.IsNullOrEmpty(packagePath))
            {
                throw new ArgumentException("Path can not be empty or null", "packagePath");
            }
            ImportPackageItem[] items = PackageUtility.ExtractAndPrepareAssetList(packagePath, out str, out flag);
            if ((items != null) && (items.Length != 0))
            {
                PackageUtility.ImportPackageAssetsImmediately(Path.GetFileNameWithoutExtension(packagePath), items, false);
            }
        }
Example #3
0
        internal static void ImportPackageImmediately(string packagePath)
        {
            if (string.IsNullOrEmpty(packagePath))
            {
                throw new ArgumentException("Path can not be empty or null", "packagePath");
            }
            string text;
            bool   flag;

            ImportPackageItem[] array = PackageUtility.ExtractAndPrepareAssetList(packagePath, out text, out flag);
            if (array != null && array.Length != 0)
            {
                string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(packagePath);
                PackageUtility.ImportPackageAssetsImmediately(fileNameWithoutExtension, array, false);
            }
        }
Example #4
0
        internal static void ImportPackageImmediately(string packagePath)
        {
            if (string.IsNullOrEmpty(packagePath))
            {
                throw new ArgumentException("Path can not be empty or null", "packagePath");
            }
            string text;
            bool   flag;

            ImportPackageItem[] array = PackageUtility.ExtractAndPrepareAssetList(packagePath, out text, out flag);
            if (array == null || array.Length == 0)
            {
                return;
            }
            PackageUtility.ImportPackageAssetsImmediately(array, false);
        }
Example #5
0
        public static void ImportPackage(string packagePath, bool interactive)
        {
            string str;
            bool   flag;

            ImportPackageItem[] items = PackageUtility.ExtractAndPrepareAssetList(packagePath, out str, out flag);
            if (items != null)
            {
                if (interactive)
                {
                    PackageImport.ShowImportPackage(packagePath, items, str, flag);
                }
                else
                {
                    PackageUtility.ImportPackageAssets(items, false);
                }
            }
        }
        /// <summary>
        ///   <para>Imports package at packagePath into the current project.</para>
        /// </summary>
        /// <param name="packagePath"></param>
        /// <param name="interactive"></param>
        public static void ImportPackage(string packagePath, bool interactive)
        {
            string packageIconPath;
            bool   canPerformReInstall;

            ImportPackageItem[] prepareAssetList = PackageUtility.ExtractAndPrepareAssetList(packagePath, out packageIconPath, out canPerformReInstall);
            if (prepareAssetList == null)
            {
                return;
            }
            if (interactive)
            {
                PackageImport.ShowImportPackage(packagePath, prepareAssetList, packageIconPath, canPerformReInstall);
            }
            else
            {
                PackageUtility.ImportPackageAssets(prepareAssetList, false);
            }
        }
Example #7
0
        public static void ImportPackage(string packagePath, bool interactive)
        {
            string packageIconPath;
            bool   allowReInstall;

            ImportPackageItem[] array = PackageUtility.ExtractAndPrepareAssetList(packagePath, out packageIconPath, out allowReInstall);
            if (array == null)
            {
                return;
            }
            if (interactive)
            {
                PackageImport.ShowImportPackage(packagePath, array, packageIconPath, allowReInstall);
            }
            else
            {
                PackageUtility.ImportPackageAssets(array, false);
            }
        }
        internal static void ImportPackageImmediately(string packagePath)
        {
            if (string.IsNullOrEmpty(packagePath))
            {
                throw new ArgumentException("Path can not be empty or null", "packagePath");
            }

            string packageIconPath;
            bool   canPerformReInstall;

            ImportPackageItem[] items = PackageUtility.ExtractAndPrepareAssetList(packagePath, out packageIconPath, out canPerformReInstall);

            if (items == null || items.Length == 0)
            {
                return;
            }

            string packageName = System.IO.Path.GetFileNameWithoutExtension(packagePath);

            PackageUtility.ImportPackageAssetsImmediately(packageName, items, false);
        }
Example #9
0
        /// <summary>
        /// <para>Imports package at packagePath into the current project.</para>
        /// </summary>
        /// <param name="packagePath"></param>
        /// <param name="interactive"></param>
        public static void ImportPackage(string packagePath, bool interactive)
        {
            string str;
            bool   flag;

            if (string.IsNullOrEmpty(packagePath))
            {
                throw new ArgumentException("Path can not be empty or null", "packagePath");
            }
            ImportPackageItem[] items = PackageUtility.ExtractAndPrepareAssetList(packagePath, out str, out flag);
            if (items != null)
            {
                if (interactive)
                {
                    PackageImport.ShowImportPackage(packagePath, items, str, flag);
                }
                else
                {
                    PackageUtility.ImportPackageAssets(Path.GetFileNameWithoutExtension(packagePath), items, false);
                }
            }
        }
Example #10
0
        public static void ImportPackage(string packagePath, bool interactive)
        {
            if (string.IsNullOrEmpty(packagePath))
            {
                throw new ArgumentException("Path can not be empty or null", "packagePath");
            }
            string packageIconPath;
            bool   allowReInstall;

            ImportPackageItem[] array = PackageUtility.ExtractAndPrepareAssetList(packagePath, out packageIconPath, out allowReInstall);
            if (array != null)
            {
                if (interactive)
                {
                    PackageImport.ShowImportPackage(packagePath, array, packageIconPath, allowReInstall);
                }
                else
                {
                    string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(packagePath);
                    PackageUtility.ImportPackageAssets(fileNameWithoutExtension, array, false);
                }
            }
        }