UnityEditor.PackageImport.ShowImportPackage C# (CSharp) Method

ShowImportPackage() public static method

public static ShowImportPackage ( string packagePath, AssetsItem items, string packageIconPath ) : void
packagePath string
items AssetsItem
packageIconPath string
return void
        public static void ShowImportPackage(string packagePath, AssetsItem[] items, string packageIconPath)
        {
            if (ValidateInput(items))
            {
                EditorWindow.GetWindow<PackageImport>(true, "Importing package").Init(packagePath, items, packageIconPath);
            }
        }

Usage Example

        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);
            }
        }
All Usage Examples Of UnityEditor.PackageImport::ShowImportPackage