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);
}
}